/* VesTRA molecule lookup. Light reading page; shared chrome (top bar, footer,
   buttons, tokens) comes from vestra.css. Bars are plain CSS, no chart library. */

html { background: var(--vx-paper); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--vx-paper); color: var(--vx-ink); font-family: var(--vx-font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }
:focus-visible { outline: 2px solid var(--vx-blood-accent); outline-offset: 2px; }

.lk-skip { position: absolute; left: 8px; top: -60px; z-index: 50; padding: 10px 14px; border-radius: 999px;
  background: #fff; color: #000; font-size: 14px; font-weight: 600; text-decoration: none; }
.lk-skip:focus { top: 8px; }

/* the shared footer's link row: let it wrap on narrow screens (links are nowrap in vestra.css) */
@media (max-width: 640px) { .vx-foot-in > span:last-child { display: flex; flex-wrap: wrap; gap: 6px 0; min-width: 0; } }

/* ---------------------------------------------------------------- frame */
.lk-main { flex: 1 0 auto; width: 100%; max-width: var(--vx-max); margin: 0 auto; padding: 40px var(--vx-gutter) 72px; min-width: 0; }
.lk-view { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------------------------------------------------------------- hero + search */
.lk-hero { display: flex; flex-direction: column; gap: 14px; padding-bottom: 28px; margin-bottom: 24px; border-bottom: 1px solid var(--vx-line); }
.lk-eyebrow { margin: 0; }
.lk-hero h1 { margin: 0; max-width: 22ch; font-size: clamp(30px, 5.2vw, 46px); line-height: 1.05; font-weight: 600; letter-spacing: -0.035em; }
.lk-lede { margin: 0; max-width: 66ch; font-size: 16px; line-height: 1.6; color: var(--vx-muted); }
/* once a result is on screen the question has been answered: keep only the eyebrow and the search */
body.has-result .lk-hero h1, body.has-result .lk-lede { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.has-result .lk-hero { padding-bottom: 22px; margin-bottom: 20px; }

.lk-search { position: relative; width: 100%; max-width: 720px; margin-top: 6px; }
.lk-field { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 18px; border-radius: 999px;
  background: var(--vx-surface); border: 1px solid #cfcbc0; color: var(--vx-muted); box-shadow: 0 1px 0 rgba(23, 22, 26, 0.03); }
.lk-field:focus-within { border-color: var(--vx-ink); box-shadow: 0 0 0 3px rgba(23, 22, 26, 0.08); }
.lk-field svg { flex: 0 0 auto; }
.lk-field input { flex: 1 1 auto; min-width: 0; padding: 12px 0; border: 0; outline: none; background: transparent;
  font: inherit; font-size: 17px; color: var(--vx-ink); }
.lk-field input::placeholder { color: var(--vx-faint); opacity: 1; }
.lk-clear { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border: 0; border-radius: 999px; background: transparent; color: var(--vx-muted); cursor: pointer; }
.lk-clear:hover { background: var(--vx-paper); color: var(--vx-ink); }
.lk-clear[hidden] { display: none; }
.lk-go { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--vx-ink); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.lk-go:hover { background: #000; }

.lk-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30; margin: 0; padding: 0; list-style: none;
  background: var(--vx-surface); border: 1px solid var(--vx-line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18); font-size: 15px; }
.lk-suggest[hidden] { display: none; }
.lk-opt { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; gap: 0 12px; align-items: baseline;
  padding: 11px 16px; cursor: pointer; min-width: 0; }
.lk-opt + .lk-opt { border-top: 1px solid var(--vx-line-soft); }
.lk-opt[aria-selected="true"], .lk-opt:hover { background: var(--vx-paper); }
.lk-opt[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--vx-ink); }
.lk-opt-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lk-opt-via { color: var(--vx-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.lk-opt-n { font-family: var(--vx-mono); font-size: 11.5px; color: var(--vx-faint); white-space: nowrap; }
.lk-opt-none { padding: 12px 16px; color: var(--vx-muted); font-size: 14px; }
.lk-release { margin: 0; font-family: var(--vx-mono); font-size: 11.5px; color: var(--vx-faint); letter-spacing: 0.02em; min-height: 1em; }

/* ---------------------------------------------------------------- shared card bits */
.lk-card { padding: 22px 24px; border-radius: var(--vx-radius); background: var(--vx-surface); border: 1px solid var(--vx-line); min-width: 0; }
.lk-card h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.lk-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--vx-muted); }
.lk-strap { margin: 0; padding: 14px 18px; border-radius: 12px; background: var(--vx-ink); color: #d6d6de; font-size: 13.5px; line-height: 1.55; }
.lk-strap b { color: #fff; font-weight: 600; }

/* ---------------------------------------------------------------- empty state */
.lk-empty { display: flex; flex-direction: column; gap: 18px; }
.lk-empty-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.lk-try { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lk-try-label { font-family: var(--vx-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--vx-muted); margin-right: 4px; }
.lk-try button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid #cfcbc0; background: var(--vx-surface); color: var(--vx-ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.lk-try button:hover { border-color: var(--vx-ink); }
.lk-try button small { font-family: var(--vx-mono); font-size: 11px; font-weight: 400; color: var(--vx-faint); }

/* ---------------------------------------------------------------- headline numbers */
.lk-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.lk-stat { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: var(--vx-radius); background: var(--vx-surface); border: 1px solid var(--vx-line); min-width: 0; }
.lk-stat dt { font-family: var(--vx-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--vx-muted); }
.lk-stat dd { margin: 0; }
.lk-stats.lk-kinds { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); margin-bottom: 12px; }
.lk-stats.lk-kinds .lk-stat dt { color: var(--vx-ink, inherit); font-family: inherit; font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.lk-stats.is-secondary .lk-stat { padding: 12px 16px; }
.lk-stats.is-secondary .lk-num { font-size: 22px; }
.lk-stat .lk-num { display: block; font-size: 36px; line-height: 1; font-weight: 600; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.lk-stat .lk-num.is-none { color: var(--vx-faint); font-weight: 400; }
.lk-stat .lk-note { margin-top: 4px; }

/* ---------------------------------------------------------------- molecule header */
.lk-mol-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 32px; }
.lk-mol-title { min-width: 0; flex: 1 1 420px; display: flex; flex-direction: column; gap: 10px; }
.lk-mol-title h2 { margin: 0; font-size: clamp(34px, 6vw, 52px); line-height: 1; font-weight: 600; letter-spacing: -0.04em; overflow-wrap: anywhere; }
.lk-ids { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--vx-mono); font-size: 12.5px; color: var(--vx-muted); }
.lk-ids span b { font-weight: 500; color: var(--vx-ink); }
.lk-syn { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lk-syn-label { font-family: var(--vx-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--vx-muted); margin-right: 4px; }
.lk-syn span.vx-pill { background: #f0eee8; color: var(--vx-ink); font-weight: 500; white-space: normal; overflow-wrap: anywhere; }
.lk-mol-actions { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.lk-mol-actions .lk-note { max-width: 32ch; }

/* ---------------------------------------------------------------- bar sections */
.lk-secs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lk-sec { display: flex; flex-direction: column; gap: 10px; }
.lk-sec .lk-note { margin-bottom: 4px; }
.lk-bars { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.lk-row { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 32px; }
.lk-row-label { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.lk-bar { height: 10px; border-radius: 3px; background: var(--vx-line-soft); overflow: hidden; }
.lk-bar i { display: block; height: 100%; min-width: 3px; border-radius: 3px; background: var(--vx-ink); }
.lk-bar.is-tissue i { background: var(--vx-tissue-accent); }
.lk-bar.is-blood i { background: var(--vx-blood-accent); }
.lk-bar.is-other i { background: var(--vx-other); }
.lk-row-n { font-family: var(--vx-mono); font-size: 12px; color: var(--vx-muted); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.lk-row-n b { font-weight: 500; color: var(--vx-ink); }
.lk-none { margin: 0; font-size: 14px; color: var(--vx-faint); }
.lk-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 0; padding: 0; list-style: none; font-family: var(--vx-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--vx-muted); }
.lk-key li { display: inline-flex; align-items: center; gap: 6px; }
.lk-key i { width: 10px; height: 10px; border-radius: 2px; }
.lk-key .k-t { background: var(--vx-tissue-accent); } .lk-key .k-b { background: var(--vx-blood-accent); } .lk-key .k-o { background: var(--vx-other); }

/* ---------------------------------------------------------------- not found, errors, loading */
.lk-msg { display: flex; flex-direction: column; gap: 10px; }
.lk-msg h2 { font-size: 22px; letter-spacing: -0.02em; }
.lk-msg h2 .lk-q { font-family: var(--vx-mono); font-weight: 500; font-size: 0.85em; background: #f0eee8; padding: 2px 8px; border-radius: 6px; overflow-wrap: anywhere; }
.lk-msg p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--vx-muted); max-width: 64ch; }
.lk-msg p b { color: var(--vx-ink); font-weight: 500; }
.lk-msg.is-error { border-left: 4px solid #a12b1c; }
.lk-loading { color: var(--vx-muted); font-size: 14px; }

/* ---------------------------------------------------------------- citation panel */
.lk-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  padding: 24px var(--vx-gutter); background: rgba(10, 10, 14, 0.55); }
.lk-overlay[hidden] { display: none; }
.lk-dialog { width: min(680px, 100%); max-height: min(82vh, 760px); display: flex; flex-direction: column; min-width: 0;
  background: var(--vx-surface); color: var(--vx-ink); border: 1px solid var(--vx-line); border-radius: var(--vx-radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35); outline: none; }
.lk-dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--vx-line-soft); }
.lk-dlg-head h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; min-width: 0; overflow-wrap: anywhere; }
.lk-dlg-close { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 999px;
  background: transparent; color: var(--vx-muted); cursor: pointer; }
.lk-dlg-close:hover { background: var(--vx-paper); color: var(--vx-ink); }
.lk-dlg-note { margin: 0; padding: 12px 20px 0; font-size: 13px; line-height: 1.5; color: var(--vx-muted); }
.lk-papers { margin: 0; padding: 8px 20px 20px; list-style: none; overflow-y: auto; display: flex; flex-direction: column; }
.lk-paper { padding: 12px 0; border-top: 1px solid var(--vx-line-soft); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lk-paper:first-child { border-top: 0; }
.lk-paper a { color: var(--vx-ink); font-weight: 500; font-size: 15px; line-height: 1.4; text-decoration: none; overflow-wrap: anywhere; }
.lk-paper a:hover { text-decoration: underline; text-underline-offset: 3px; }
.lk-paper .lk-paper-t { font-weight: 500; font-size: 15px; line-height: 1.4; }
.lk-paper-meta { font-size: 13px; color: var(--vx-muted); overflow-wrap: anywhere; }
.lk-paper-meta code { font-family: var(--vx-mono); font-size: 11.5px; color: var(--vx-faint); }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 900px) {
  .lk-secs { grid-template-columns: minmax(0, 1fr); }
  .lk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .lk-main { padding-top: 28px; padding-bottom: 56px; }
  .lk-hero { gap: 12px; padding-bottom: 22px; margin-bottom: 20px; }
  .lk-field { padding: 5px 5px 5px 14px; gap: 10px; }
  .lk-field input { font-size: 16px; padding: 10px 0; }
  .lk-go { min-height: 40px; padding: 0 16px; }
  .lk-opt { grid-template-columns: minmax(0, 1fr) auto; }
  .lk-opt-via { display: none; }
  .lk-card, .lk-stat { padding: 16px 16px; }
  .lk-stat .lk-num { font-size: 30px; }
  .lk-row { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); grid-template-areas: "label bar" "label n"; gap: 4px 12px; align-items: start; }
  .lk-row-label { grid-area: label; font-size: 13.5px; padding-top: 1px; }
  .lk-bar { grid-area: bar; margin-top: 4px; }
  .lk-row-n { grid-area: n; text-align: left; white-space: normal; }
  .lk-overlay { padding: 12px var(--vx-gutter); align-items: flex-end; }
  .lk-dialog { max-height: 86vh; }
  .lk-dlg-head, .lk-dlg-note, .lk-papers { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .lk-bar i { transition: width 0.35s ease-out; }
}
@media print { .lk-overlay { position: static; background: none; padding: 0; } .lk-dlg-close, .lk-go, .lk-clear { display: none; } }

/* "Show all N" / "+N more": a plain text button, never mistaken for a link out */
.lk-more { margin: 14px 0 0; background: transparent; border: 1px solid var(--vx-line); border-radius: 999px;
  padding: 7px 16px; font: 500 13.5px var(--vx-font); color: var(--vx-muted); cursor: pointer; }
.lk-more:hover { border-color: var(--vx-faint); color: var(--vx-ink); }
.lk-more:focus-visible { outline: 2px solid var(--vx-ink); outline-offset: 2px; }
.lk-more-inline { margin: 0; padding: 2px 10px; font-size: 12.5px; vertical-align: baseline; }
/* the rows and pills these buttons reveal set display, which beats [hidden] */
.lk-bars li[hidden], .lk-syn [hidden], .lk-ids [hidden] { display: none; }

/* ---- molecule tools: Download PDF, Cite */
.lk-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lk-cite h2 { margin: 0 0 6px; font-size: 18px; }
.lk-cite-block { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--vx-line); }
.lk-cite-block:first-of-type { border-top: 0; }
.lk-cite-text { margin: 0; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.lk-cite-bib { margin: 0; font-family: var(--vx-mono); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; flex: 1; min-width: 0; }
.lk-copy { flex: none; }
@media (max-width: 640px) { .lk-cite-block { flex-direction: column; } }
/* ---- type filter under the search */
.lk-types { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.lk-type { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--vx-line); background: var(--vx-surface); color: var(--vx-muted); cursor: pointer; }
.lk-type:hover { color: var(--vx-ink); }
.lk-type.is-on { background: var(--vx-ink); color: #fff; border-color: var(--vx-ink); }
/* ---- the server-written summary a /m/ page carries until the script takes over */
.lk-seo h2 { margin: 0 0 8px; }
.lk-seo p { margin: 6px 0 0; color: var(--vx-muted); }
/* ---- PDF report: print only */
.lk-print { display: none; }
@media print {
  body > *:not(#lk-print):not(main) { display: none !important; }
  main > *:not(#lk-print) { display: none !important; }
  .vxfb-btn, .vxfb-panel { display: none !important; }
  .lk-print { display: block !important; color: #000; font-size: 11pt; }
  .lk-print .pr-brand { font-size: 9pt; letter-spacing: .08em; text-transform: uppercase; color: #555; margin: 0; }
  .lk-print h1 { font-size: 20pt; margin: 4pt 0; }
  .lk-print .pr-meta, .lk-print .pr-note { font-size: 9pt; color: #444; margin: 2pt 0; }
  .lk-print table { width: 100%; border-collapse: collapse; margin: 6pt 0; }
  .lk-print th, .lk-print td { text-align: left; padding: 3pt 6pt; border-bottom: .5pt solid #ccc; font-size: 9.5pt; }
  .lk-print h3 { font-size: 12pt; margin: 14pt 0 4pt; break-after: avoid; }
  .lk-print .pr-papers li { font-size: 9pt; margin: 0 0 4pt; break-inside: avoid; }
  @page { margin: 16mm; }
}

/* ---- extra evidence lists: release control, methylation, peptides, variants, probes */
.lk-layer-list { list-style: none; margin: 14px 0 0; padding: 0; }
.lk-layer-list li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--vx-line); font-size: 14px; }
.lk-layer-list li:first-child { border-top: 0; }
.lk-layer-id { min-width: 0; overflow-wrap: anywhere; }
.lk-layer-id.is-mono { font-family: var(--vx-mono); font-size: 12.5px; }

/* conditions and trials in the search list */
.lk-opt.is-dis .lk-opt-via { color: var(--vx-ink); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.lk-opt.is-trials { background: var(--vx-paper); }
.lk-opt.is-trials .lk-opt-name { font-weight: 500; }
.lk-opt.is-trials .lk-opt-n { color: var(--vx-ink); }

/* a condition: every molecule its studies reported */
.lk-d-types { margin: 4px 0 14px; }
.lk-d-list { list-style: none; margin: 0; padding: 0; columns: 2 300px; column-gap: 28px; }
.lk-d-list li { break-inside: avoid; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--vx-line-soft); font-size: 14.5px; }
.lk-d-list a { color: var(--vx-ink); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-d-list a:hover { text-decoration: underline; }
.lk-d-list small { color: var(--vx-faint); font-size: 12px; }
.lk-d-list .lk-row-n { white-space: nowrap; }
a.lk-row-label { color: var(--vx-ink); text-decoration: underline; text-decoration-color: var(--vx-line); text-underline-offset: 3px; }
a.lk-row-label:hover { text-decoration-color: currentColor; }
.lk-trials .lk-layer-id { color: var(--vx-ink); text-decoration: none; }
.lk-trials .lk-layer-id:hover { text-decoration: underline; }
.lk-cptac .lk-layer-id { color: var(--vx-ink); text-decoration: none; }
.lk-cptac .lk-layer-id:hover { text-decoration: underline; }
.lk-cp-sub { margin: 18px 0 0; font-size: 14px; font-weight: 600; }
.lk-cp-cite { margin-top: 16px; font-size: 12.5px; }
.lk-tr-all { color: var(--vx-ink); font-weight: 500; }
