:root {
  --accent: #1b3a6b;
  --accent-soft: #eef2f8;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --border: #e6e8ec;
  --border-strong: #d4d8df;
  --ink: #161a21;
  --ink-2: #4a5263;
  --ink-3: #7b8294;
  --radius: 8px;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --cell: 30px;
  --row: 26px;
  --matrix-label: 348px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: clip; }

/* scrollbars — thin, with a transparent track */
* { scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, 0.3) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.3); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.45); }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.45;
}
button { font-family: inherit; cursor: pointer; }
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  height: 56px; padding: 0 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; text-decoration: none; color: inherit; }
.brand-mark { width: 44px; height: 44px; flex: none; }
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; gap: 1px; line-height: 1.08; }
.brand-word { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; color: var(--accent); }
.brand-word .two { color: var(--accent-2); }
.brand-name { font-weight: 500; letter-spacing: 0.005em; font-size: 13px; white-space: nowrap; color: var(--ink-3); }
@media (max-width: 760px){ .brand-name { display: none; } }
.brand-tag { color: var(--ink-3); font-size: 12px; font-family: var(--mono); }

.topbar .topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }

/* ---------- search ---------- */
.searchbox {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 0 12px; height: 40px;
  transition: border-color .15s, box-shadow .15s;
}
.searchbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.searchbox input {
  border: none; outline: none; background: transparent; font-family: var(--mono);
  font-size: 14px; color: var(--ink); flex: 1; min-width: 0;
}
.searchbox .ico { color: var(--ink-3); display: grid; place-items: center; }
.searchbox.compact { height: 34px; }
.searchbox-wrap { position: relative; }
.searchbox-wrap.compact { width: 400px; max-width: 42vw; }

/* typeahead suggestions */
.search-suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 14px 36px rgba(0,0,0,.14); z-index: 60; max-height: 360px; overflow-y: auto; }
.sug-item { display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.sug-item:last-child { border-bottom: none; }
.sug-item.active { background: var(--accent-soft); }
.sug-q { font-weight: 600; font-size: 14px; color: var(--ink); }
.sug-q.mono { font-family: var(--mono); }
.sug-sub { color: var(--ink-3); font-size: 12px; font-family: var(--mono); }
.sug-type { margin-left: auto; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); border: 1px solid var(--border); border-radius: 5px; padding: 1px 7px; align-self: center; }

.btn {
  height: 36px; padding: 0 14px; border-radius: 7px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; }

/* ---------- home ---------- */
.home { max-width: 940px; margin: 0 auto; padding: 0 24px 80px; text-align: center; }
.home-hero { min-height: calc(100dvh - 56px); display: flex; flex-direction: column; justify-content: center; padding: 24px 0; box-sizing: border-box; }
.home h1 { font-size: 56px; font-weight: 600; letter-spacing: -0.03em; margin: 0 0 18px; line-height: 1.05; }
.home .lede { color: var(--ink-2); font-size: 16px; max-width: 740px; margin: 0 auto 40px; line-height: 1.55; }
.home .searchbox-wrap { width: 100%; max-width: 720px; margin: 0 auto; }
.home .searchbox { height: 72px; }
.home .searchbox input { font-size: 19px; }
.examples { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-top: 22px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); border-radius: 22px;
  padding: 8px 16px; font-size: 14px; display: inline-flex; align-items: baseline; gap: 8px;
  transition: border-color .12s, background .12s; cursor: pointer; text-decoration: none;
}
.chip .q { color: var(--ink); }
.chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.chip .q { font-family: var(--mono); font-weight: 500; }
.chip .sub { color: var(--ink-3); font-size: 12px; }

.stats { display: flex; gap: 0; justify-content: center; align-items: flex-start; margin-top: 60px; border-top: 1px solid var(--border); padding-top: 36px; }
.stat { padding: 0 40px; position: relative; }
.stat:not(:last-child)::after { content: ""; position: absolute; right: 0; top: 4px; width: 1px; height: 66px; background: var(--border); }
.stat-ico { width: 52px; height: 52px; margin: 18px auto 0; color: var(--accent); }
.stat-ico svg { width: 52px; height: 52px; }
.stat-ico.wide { width: 80px; }
.stat-ico.wide svg { width: 80px; height: 52px; }
.stat .n { font-size: 37px; font-weight: 600; font-family: var(--mono); letter-spacing: -0.02em; }
.stat .l { color: var(--ink-3); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; min-height: 2.2em; line-height: 1.15; display: flex; align-items: flex-start; justify-content: center; }

/* ---------- home figures ---------- */
.viz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 27px; text-align: left; }
@media (max-width: 820px){ .viz-grid { grid-template-columns: 1fr; } }
.viz-card { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 22px 22px 24px; }
.viz-head h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.viz-head p { margin: 0 0 16px; font-size: 13px; color: var(--ink-3); line-height: 1.5; }

/* organ grid (tissue figure) — deliberately scattered */
.organs { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 18px 18px; padding: 16px 4px 12px; }
.organ { position: relative; width: 58px; height: 58px; color: var(--accent); cursor: default; transition: transform .16s cubic-bezier(.3,1.3,.5,1); }
.organ svg { width: 58px; height: 58px; }
.organ:hover { transform: translateY(-6px) scale(1.18); z-index: 3; }
.organ::after { content: attr(data-name); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%) translateY(4px); background: #11151c; color: #fff; font-size: 11.5px; font-weight: 500; padding: 4px 9px; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; box-shadow: 0 6px 18px rgba(0,0,0,.28); z-index: 4; }
.organ::before { content: ""; position: absolute; left: 50%; bottom: calc(100% + 3px); transform: translateX(-50%); border: 5px solid transparent; border-top-color: #11151c; opacity: 0; transition: opacity .15s; pointer-events: none; z-index: 4; }
.organ:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.organ:hover::before { opacity: 1; }

/* evidence composition bar */
.evbar-track { display: flex; height: 78px; border-radius: 10px; overflow: hidden; gap: 2px; }
.evbar-seg { display: flex; flex-direction: column; align-items: center; justify-content: space-between; color: #fff; min-width: 0; padding: 10px 4px; overflow: hidden; }
.evbar-short { font-size: 12.5px; font-weight: 600; line-height: 1.15; text-align: center; white-space: normal; }
.evbar-n { font-family: var(--mono); font-size: 18px; font-weight: 600; }
.evbar-legend { margin-top: 16px; display: flex; flex-direction: column; gap: 16px; }
.ebl-name { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.ebl-items { font-size: 14.5px; color: var(--ink-3); line-height: 1.5; margin-top: 3px; }

.how { margin-top: 56px; text-align: left; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.how .step { background: var(--surface); padding: 18px 18px 20px; }
.how .step .k { font-family: var(--mono); font-size: 11px; color: var(--accent); font-weight: 600; }
.how .step h4 { margin: 6px 0 5px; font-size: 14px; }
.how .step p { margin: 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }

/* ---------- page chrome ---------- */
.page { max-width: 1320px; margin: 0 auto; padding: 22px 24px 80px; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 13px; margin-bottom: 14px; }
.crumbs a { color: var(--ink-2); cursor: pointer; text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

/* subject header */
.subject {
  display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 18px;
}
.subject .title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; display: flex; align-items: center; gap: 14px; }
.subject .meta { display: flex; flex-wrap: wrap; gap: 7px 18px; margin-top: 8px; color: var(--ink-2); font-size: 13px; }
.subject .meta b { color: var(--ink); font-weight: 500; }
.subject .meta .meta-muted { color: var(--ink-3); }
.subject .meta .meta-muted b { color: var(--ink-3); font-weight: 500; }
/* scorecard subject meta — labelled facts with vertical dividers (avoids the cramped run-on) */
.subject .meta.sc-meta { gap: 9px 0; align-items: center; margin-top: 12px; }
.subject .meta.sc-meta .mi { display: inline-flex; align-items: baseline; gap: 7px; padding: 0 12px; border-left: 1px solid var(--border); white-space: nowrap; }
.subject .meta.sc-meta .mi:first-child { padding-left: 0; border-left: none; }
.subject .meta.sc-meta .mi-l { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); font-weight: 600; }
.subject .meta.sc-meta .mi b { color: var(--ink); font-weight: 600; }
.subject .meta.sc-meta .mi-sub { color: var(--ink-3); margin-left: -2px; }
.tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 11px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---------- results table ---------- */
.tablewrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.table-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.table-head .sub { color: var(--ink-3); font-size: 12.5px; }

/* in-results filter (jump to a row without paging) */
.results-filter { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 6px 0 10px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); transition: border-color .12s, box-shadow .12s; }
.results-filter:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.results-filter .rf-ico { color: var(--ink-3); display: grid; place-items: center; }
.results-filter input { border: none; outline: none; background: transparent; font-family: var(--mono); font-size: 12.5px; color: var(--ink); width: 200px; min-width: 0; }
.results-filter .rf-clear { border: none; background: transparent; color: var(--ink-3); font-size: 17px; line-height: 1; cursor: pointer; padding: 0 3px; border-radius: 4px; }
.results-filter .rf-clear:hover { color: var(--accent); }
td.no-match { text-align: center; color: var(--ink-3); padding: 30px 14px; font-size: 13px; }
table.results { width: 100%; border-collapse: collapse; font-size: 13px; }
table.results th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.results td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.results tr:last-child td { border-bottom: none; }
table.results tbody tr { cursor: pointer; transition: background .1s; }
table.results tbody tr:hover { background: var(--accent-soft); }
.rank { color: var(--ink-3); font-family: var(--mono); width: 28px; }
.gsym { font-weight: 600; font-size: 14px; }
.gid { color: var(--ink-3); font-family: var(--mono); font-size: 11.5px; }

.scorecell { display: flex; align-items: center; gap: 10px; min-width: 130px; }
.scorebar { flex: 1; height: 7px; background: var(--surface-2); border-radius: 4px; overflow: hidden; min-width: 60px; }
.scorebar > i { display: block; height: 100%; border-radius: 4px; }
.scorenum { font-family: var(--mono); font-weight: 600; width: 38px; text-align: right; }

/* evidence-support bar (count + completeness fill) */
.evcell { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.evnum { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.evnum i { font-style: normal; font-size: 11px; color: var(--ink-3); font-weight: 400; }
.evbar { position: relative; flex: 1; height: 9px; background: var(--surface-2); border-radius: 5px; overflow: hidden; min-width: 70px; }
.evbar > i { position: absolute; inset: 0 auto 0 0; border-radius: 5px; }
.evmax { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--accent); }
th.sortable.on { color: var(--accent); background: var(--accent-soft); }
table.results th.evcat { text-transform: none; }

/* pager (Material-style: rows-per-page + range + first/prev/next/last) */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 18px; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--ink-2); }
.pager.pager-top { border-top: none; border-bottom: 1px solid var(--border); }
.pager .pager-rpp { color: var(--ink-3); }
.pager .rpp-select { font-family: var(--sans); font-size: 13px; color: var(--ink); border: 1px solid var(--border-strong); border-radius: 7px; padding: 4px 8px; background: var(--surface); cursor: pointer; }
.pager .pager-info { color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 120px; text-align: right; }
.pager .pager-btns { display: flex; align-items: center; gap: 2px; }
.pager .pager-btns button { display: grid; place-items: center; width: 32px; height: 32px; border: none; background: transparent; border-radius: 7px; color: var(--ink-2); cursor: pointer; }
.pager .pager-btns button:hover:not([disabled]) { background: var(--accent-soft); color: var(--accent); }
.pager .pager-btns button[disabled] { opacity: .3; cursor: default; }

/* top-tissue column */
td.toptissue { white-space: nowrap; }
td.toptissue .tt-name { font-size: 12.5px; color: var(--ink); }
td.toptissue .tt-n { margin-left: 8px; color: var(--ink-3); font-size: 11px; }

/* category sub-score columns */
td.catnum { font-family: var(--mono); color: var(--ink-3); }
td.catnum span { display: inline-block; min-width: 20px; text-align: center; }
td.catnum span.on { color: var(--ink); font-weight: 600; background: var(--accent-soft); border-radius: 5px; padding: 1px 6px; }

/* synthetic-data note + sample download */
.db-note { display: flex; align-items: flex-start; gap: 9px; max-width: 620px; margin: 40px auto 0; padding: 13px 16px; background: var(--accent-soft); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; color: var(--ink-2); text-align: left; }
.db-note svg { flex-shrink: 0; margin-top: 2px; color: var(--accent); }
.linkbtn { background: none; border: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 0 0 0 4px; text-decoration: underline; }

/* async busy bar */
.busybar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200; background: transparent; overflow: hidden; }
.busybar > i { display: block; height: 100%; width: 40%; background: var(--accent); border-radius: 2px; animation: busyslide 1s ease-in-out infinite; }
@keyframes busyslide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.db-note.ok { background: #eef7f0; border-color: #cbe6d3; color: #2c5238; }
.db-note.ok svg { color: #1b7a3a; }

/* data-source pill in top bar */
.dbpill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 16px; font-size: 12px; font-weight: 500; border: 1px solid var(--border-strong); cursor: default; white-space: nowrap; }
.dbpill .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dbpill.live { background: #eef7f0; border-color: #cbe6d3; color: #1b7a3a; }
.dbpill.live .dot { background: #1b7a3a; box-shadow: 0 0 0 3px rgba(27,122,58,.16); }
.dbpill.demo { background: #fdf4e7; border-color: #f0dcb8; color: #9a6b1a; }
.dbpill.demo .dot { background: #d99423; }
.dbpill .cnt { opacity: .7; font-size: 11px; }

/* demo-data banner (shown only when the live API is unreachable) */
.demo-banner { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 10px 22px; background: #fdf4e7; border-bottom: 1px solid #f0dcb8; color: #7a4e12; font-size: 13px; }
.demo-banner-tag { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; background: #d99423; color: #fff; padding: 2px 8px; border-radius: 5px; }
.demo-banner-msg { color: #8a5e1c; }

.minibars { display: inline-flex; gap: 2px; align-items: flex-end; height: 22px; }
.minibars i { width: 5px; background: var(--accent); border-radius: 1px; opacity: .9; }

/* ---------- scorecard / heatmap ---------- */
.sc-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 7px; overflow: hidden; }
.seg button { border: none; background: var(--surface); padding: 7px 12px; font-size: 12.5px; color: var(--ink-2); border-right: 1px solid var(--border); white-space: nowrap; }
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--accent); color: #fff; }
.toolbar-label { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; margin-right: -2px; white-space: nowrap; }

.heatmap-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.heat-scroll { overflow: auto; max-height: 76vh; position: relative; }

.heatgrid { display: grid; width: 100%; min-width: 0; }
.hg-cell { height: var(--row); display: grid; place-items: center; border-right: 1px solid rgba(0,0,0,.035); border-bottom: 1px solid rgba(0,0,0,.04); cursor: default; }
.hg-cell .sq { width: 100%; height: 100%; }
.hg-cell .dot { border-radius: 50%; background: var(--accent); }
.hg-cell.empty { background: repeating-linear-gradient(-45deg, #f4f5f7 0 3px, #fbfbfc 3px 6px); }
.hg-cell.blank { background: var(--surface); }
.hg-cell.nonsig { background: var(--surface); }
.hg-cell.nonsig::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong); opacity: .55; }
.hg-cell:hover { outline: 2px solid var(--accent); outline-offset: -2px; z-index: 5; }

/* sticky bits */
.hg-corner, .hg-colcat, .hg-colname { position: sticky; top: 0; z-index: 20; background: var(--surface); }
.hg-rowlabel, .hg-sysrow { position: sticky; left: 0; z-index: 15; background: var(--surface); }
.hg-corner { z-index: 30; left: 0; }

.hg-rowlabel { display: grid; grid-template-columns: 1fr 46px 44px; align-items: center; gap: 9px; height: var(--row); padding: 0 12px 0 14px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); font-size: 12px; }
.hg-rowlabel:hover { z-index: 41; }
.hg-rowlabel .tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hg-rowlabel .tbar { position: relative; width: 46px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: visible; cursor: default; }
.hg-rowlabel .tbar > i { display: block; height: 100%; border-radius: 3px; pointer-events: none; }
.hg-rowlabel .tbar:hover::after { content: attr(data-dec); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); background: #11151c; color: #fff; font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 5px; white-space: nowrap; z-index: 60; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.hg-rowlabel .tnum { font-family: var(--mono); font-size: 11px; text-align: right; color: var(--ink-2); white-space: nowrap; }
.hg-rowlabel .tnum i { font-style: normal; font-size: 10px; color: var(--ink-3); }

.hg-sysrow { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.hg-sysrow .caret { color: var(--ink-3); transition: transform .15s; }
.hg-sysrow.collapsed .caret { transform: rotate(-90deg); }
.hg-sysrow .syscount { color: var(--ink-3); font-weight: 500; font-family: var(--mono); }
.hg-sysfill { background: var(--surface-2); border-bottom: 1px solid var(--border); position: sticky; top: 0; }

.hg-colcat { height: 26px; display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: #fff; border-right: 2px solid var(--surface); }
.hg-colname { height: 120px; display: flex; align-items: flex-end; justify-content: center; min-width: 0; overflow: hidden; padding-bottom: 7px; border-right: 1px solid rgba(0,0,0,.04); border-bottom: 1px solid var(--border); }
.hg-colname span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; color: var(--ink-2); white-space: nowrap; font-family: var(--mono); }
.hg-corner { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); display: flex; align-items: flex-end; justify-content: center; padding: 0 0 7px 0; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }

/* legend */
.legend { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend .scale { display: flex; align-items: center; gap: 8px; }
.legend .scalebar { width: 160px; height: 10px; border-radius: 3px; }
.legend .nd { width: 16px; height: 16px; border-radius: 3px; background: repeating-linear-gradient(-45deg, #f4f5f7 0 3px, #fbfbfc 3px 6px); border: 1px solid var(--border); }
.legend .ns { width: 16px; height: 16px; border-radius: 3px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; }
.legend .ns::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong); opacity: .7; }
.legend .sigsq { width: 16px; height: 16px; border-radius: 3px; }

/* tooltip */
.tip { position: fixed; z-index: 100; pointer-events: none; background: #11151c; color: #fff; border-radius: 8px; padding: 9px 11px; font-size: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.28); max-width: 230px; }
.tip .t-ev { font-weight: 600; }
.tip .t-sub { color: #aeb6c6; font-size: 11px; margin-top: 1px; }
.tip .t-val { font-family: var(--mono); margin-top: 6px; font-size: 16px; font-weight: 600; }
.tip .t-meta { color: #aeb6c6; font-size: 11px; margin-top: 2px; }

.note { font-size: 12px; color: var(--ink-3); margin-top: 12px; display: flex; gap: 7px; align-items: flex-start; }
.note svg { flex-shrink: 0; margin-top: 1px; }

.empty-state { text-align: center; padding: 80px 20px; color: var(--ink-3); }
.empty-state .mono { color: var(--ink); font-size: 15px; }

/* ---------- not found ---------- */
.notfound { max-width: 920px; margin: 56px auto 0; text-align: center; padding: 8px 28px 100px; }
.notfound h2 { font-size: 38px; font-weight: 600; margin: 0 0 16px; letter-spacing: -0.025em; }
.notfound p { color: var(--ink-2); font-size: 18px; line-height: 1.65; margin: 0 auto 40px; max-width: 700px; }
.notfound .nf-search .searchbox-wrap { max-width: 760px; margin: 0 auto; }
.notfound .nf-search .searchbox { height: 72px; font-size: 19px; }
.notfound .nf-search .searchbox input { font-size: 19px; }
.notfound .nf-search .searchbox .btn { font-size: 16px; padding: 12px 26px; }
.notfound .nf-sug { margin-top: 44px; }
.notfound .nf-sug-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); margin-bottom: 16px; }
.notfound .nf-sug .chip { font-size: 16px; padding: 11px 22px; }
.notfound .nf-sug .chip .sub { font-size: 13px; }

/* ---------- nav links ---------- */
.nav { display: flex; align-items: center; gap: 4px; }
.navlink { background: none; border: none; color: var(--ink-2); font-size: 13.5px; font-weight: 500; padding: 7px 12px; border-radius: 7px; white-space: nowrap; cursor: pointer; text-decoration: none; display: inline-block; }
.navlink:hover { background: var(--surface-2); color: var(--ink); }
.navlink.on { color: var(--accent); }

/* entity cross-links */
.elink { color: var(--accent); cursor: pointer; text-decoration: none; border-bottom: 1px solid transparent; }
.elink:hover { border-bottom-color: var(--accent); }
.gsym.elink, .gsym .elink { color: var(--ink); }
.gsym.elink:hover { color: var(--accent); }

/* ---------- entity detail panels ---------- */
.detail-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 18px; align-items: start; }
@media (max-width: 880px){ .detail-cols { grid-template-columns: 1fr; } }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; align-items: stretch; }
@media (max-width: 880px){ .detail-grid { grid-template-columns: 1fr; } }
.summary-panel { display: flex; flex-direction: column; }
.summary-panel .summary-body { flex: 1; }
.summary-source { padding: 11px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--ink-3); }
.summary-source .elink { font-weight: 500; }
.ext-panel { margin-bottom: 18px; }
.ext-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; padding: 16px; }
.ext-card { display: flex; flex-direction: column; gap: 12px; justify-content: space-between; min-height: 74px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 15px 16px; text-decoration: none; background: var(--surface); transition: border-color .12s, background .12s, transform .08s; }
.ext-card:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.ext-card-name { font-weight: 600; font-size: 15px; color: var(--ink); }
.ext-card-go { font-size: 12px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.ext-card:hover .ext-card-go { color: var(--accent); }
.ext-card-go svg { opacity: .7; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.panel > h3 { margin: 0; font-size: 13px; font-weight: 600; padding: 13px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.panel .body { padding: 6px 16px 14px; }

.deflist { display: grid; grid-template-columns: 0.8fr 1.2fr; padding: 6px 28px 14px; }
.deflist dt { color: var(--ink-3); font-size: 12.5px; padding: 11px 16px 11px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.deflist dd { margin: 0; font-size: 13.5px; padding: 11px 0 11px 0; border-bottom: 1px solid var(--border); text-align: right; }
.deflist dt:last-of-type, .deflist dd:last-of-type { border-bottom: none; }
.deflist dd .mono { font-size: 13px; }

.descbox { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; padding: 14px 16px 16px; }
.loading-txt { color: var(--ink-3); font-style: italic; }
.descbox.empty { color: var(--ink-3); font-style: italic; }

.ext-links { display: flex; flex-wrap: wrap; gap: 7px; padding: 14px 16px; }
.ext-link { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 7px; padding: 6px 11px; font-size: 12.5px; color: var(--ink-2); text-decoration: none; background: var(--surface); }
.ext-link:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ext-link svg { opacity: .6; }

.placeholder-note { padding: 14px 16px; font-size: 12.5px; color: var(--ink-3); border-top: 1px dashed var(--border-strong); background: repeating-linear-gradient(135deg, var(--surface) 0 8px, var(--surface-2) 8px 9px); }
.illus { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-3); font-family: var(--mono); border: 1px solid var(--border); border-radius: 5px; padding: 2px 7px; }

/* ---------- documentation ---------- */
.docs { max-width: 1060px; margin: 0 auto; padding: 34px 28px 100px; }
.docs h1 { font-size: 38px; font-weight: 600; letter-spacing: -0.025em; margin: 0 0 10px; }
.docs .lede { color: var(--ink-2); font-size: 18px; max-width: 840px; line-height: 1.6; margin: 0 0 16px; }
.docs .panel > h3 { font-size: 15px; }
.docs .panel { margin-top: 22px; }
.docs .descbox { font-size: 15px; line-height: 1.65; }
/* Sources page: variants / genes / tissues input boxes */
.src-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 760px){ .src-2col { grid-template-columns: 1fr; } }
.src-xref { margin: 14px 0 0; font-size: 13px; color: var(--ink-3); }
.doc-method .mdata.mpaper { margin-top: 8px; }
.doc-method .mnote { margin: 12px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-3); }
.tinytok { font-family: var(--mono); font-size: 0.8em; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); }
.doc-toc { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 18px 0 30px; }
.doc-toc-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); font-weight: 600; margin-right: 2px; }
.toc-chip { display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 9px; font-size: 13px; font-weight: 500; color: var(--ink-2); text-decoration: none; border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 16px; cursor: pointer; transition: border-color .12s, background .12s, color .12s; }
.toc-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.toc-ct { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--surface-2); color: var(--ink-3); font-family: var(--mono); font-size: 11.5px; font-weight: 600; }
.toc-chip:hover .toc-ct { background: var(--surface); color: var(--accent); }
.doc-cat { margin-top: 38px; scroll-margin-top: 70px; }
.doc-cat .ch { display: flex; align-items: baseline; gap: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--accent); margin-bottom: 4px; }
.doc-cat .ch h2 { font-size: 23px; font-weight: 600; margin: 0; }
.doc-cat .ch .count { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.doc-cat .ch-blurb { color: var(--ink-2); font-size: 13.5px; margin: 4px 0 8px; }
.doc-method { scroll-margin-top: 70px; display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 20px 4px; border-bottom: 1px solid var(--border); scroll-margin-top: 70px; }
.doc-method:last-child { border-bottom: none; }
.doc-method .mname { font-weight: 600; font-size: 16px; }
.doc-method .mfull { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.doc-method .mdesc { font-size: 14.5px; color: var(--ink-2); line-height: 1.6; margin: 0; }
.doc-method .msrc { font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); margin-top: 8px; }
.doc-method .mdata { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 11px; }
.doc-method .mdata-lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); font-weight: 600; margin-right: 2px; }
.doc-method .mdata-link { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border-strong); border-radius: 7px; padding: 4px 10px; font-size: 12px; color: var(--ink-2); text-decoration: none; font-family: var(--mono); }
.doc-method .mdata-link:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.doc-method .mdata-link svg { opacity: .55; }
.doc-method.hit .mname { color: var(--accent); }
.doc-scale { display: flex; align-items: center; gap: 12px; margin: 18px 0 6px; }
.doc-scale .bar { width: 220px; height: 12px; border-radius: 3px; }

/* ---------- additions: 3-state cells, coverage, new pages ---------- */
/* not-assayed cell: grey diagonal lines (top-right → bottom-left) */
.hg-cell.absent { background: repeating-linear-gradient(-45deg, #e6e9ee 0 4px, #f4f5f8 4px 8px); cursor: default; }
.hg-cell.absent:hover { outline: 2px solid var(--border-strong); }

/* clickable evidence column headers (by-score view) */
.hg-colname.clickable { cursor: pointer; }
.hg-colname.clickable:hover { background: color-mix(in srgb, var(--accent) 7%, white); }
.hg-colname.clickable:hover span { color: var(--ink); font-weight: 600; }
.hg-colname.sorted { background: color-mix(in srgb, var(--accent) 12%, white); box-shadow: inset 0 -3px 0 var(--accent); }
.hg-colname.sorted span { color: var(--ink); font-weight: 600; }

/* by-score hint line */
.score-hint { font-size: 12.5px; color: var(--ink-2); margin: -4px 0 14px; padding: 9px 13px; background: var(--accent-soft); border: 1px solid var(--border); border-radius: var(--radius); }
.score-hint b { color: var(--ink); }
.score-hint a { color: var(--accent); cursor: pointer; text-decoration: underline; margin-left: 4px; }

/* coverage pill on the Sources page */
.covpill { display: inline-block; margin-left: 10px; padding: 1px 9px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; }

/* GeneCards source tag in the Summary header */
.src-tag { margin-left: auto; font-family: var(--mono); font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); border: 1px solid var(--border); border-radius: 5px; padding: 1px 7px; }

/* documentation lists */
.doclist { margin: 10px 0 2px; padding-left: 18px; }
.doclist li { margin: 6px 0; }
.critlist { list-style: none; margin: 14px 0 2px; padding: 0; display: flex; flex-direction: column; }
.critlist li { display: grid; grid-template-columns: 168px 1fr; gap: 18px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--border); }
.critlist li:first-child { padding-top: 4px; }
.critlist li:last-child { border-bottom: none; padding-bottom: 2px; }
.critlist .ct { font-weight: 600; color: var(--ink); font-size: 13.5px; letter-spacing: -0.01em; }
.critlist .cd { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
@media (max-width: 620px){ .critlist li { grid-template-columns: 1fr; gap: 3px; } }
.statelist { margin: 12px 0 4px; display: flex; flex-direction: column; gap: 9px; }
.staterow { display: flex; align-items: flex-start; gap: 10px; }
.staterow > span:first-child { flex-shrink: 0; margin-top: 2px; }
.staterow b { color: var(--ink); }

/* ---------- about page ---------- */
.about { max-width: 1040px; }
.about .eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); margin-bottom: 14px; }

/* hero */
.about-hero { padding: 8px 0 30px; }
.about-hero h1 { font-size: 44px; line-height: 1.07; letter-spacing: -0.03em; margin: 0 0 18px; max-width: 18ch; }
.about-hero .lede { font-size: 18px; color: var(--ink-2); line-height: 1.62; margin: 0; max-width: 62ch; }

/* numbers band */
.about-numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin: 8px 0; }
@media (max-width: 620px){ .about-numbers { grid-template-columns: repeat(2, 1fr); } }
.about-num { background: var(--surface); padding: 22px 18px; text-align: center; }
.about-num .n { font-size: 29px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.about-num .n.mono { font-family: var(--mono); }
.about-num .l { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); margin-top: 7px; }

/* text blocks */
.about-block { padding: 38px 0; border-top: 1px solid var(--border); }
.about-block > h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 16px; }
.about-block-body { max-width: none; }
.about-block-body p { font-size: 16.5px; line-height: 1.72; color: var(--ink-2); margin: 0 0 16px; }
.about-block-body p:last-child { margin-bottom: 0; }
.about-block-body b, .about-how-text b { color: var(--ink); font-weight: 600; }

/* pull stat (light card with accent rule) */
.about-pull { display: flex; align-items: center; gap: 24px; margin-top: 36px; padding: 24px 28px; background: var(--accent); border-radius: 14px; box-shadow: 0 14px 34px -20px rgba(27,58,107,.7); }
.about-pull .big { font-family: var(--mono); font-size: 46px; font-weight: 600; color: #fff; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.about-pull .txt { font-size: 15px; color: rgba(255,255,255,0.84); line-height: 1.55; }

/* how it works + figure */
.about-how { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; padding: 38px 0; border-top: 1px solid var(--border); }
@media (max-width: 840px){ .about-how { grid-template-columns: 1fr; gap: 28px; } }
.about-how-text h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 16px; }
.about-how-text p { font-size: 16px; line-height: 1.7; color: var(--ink-2); margin: 0 0 14px; }
.about-how-text p:last-child { margin-bottom: 0; }
.about-how-viz { margin-top: 48px; }
@media (max-width: 840px){ .about-how-viz { margin-top: 0; } }

/* labeled mini matrix */
.mx { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 18px; box-shadow: 0 8px 26px -18px rgba(16,21,30,.3); }
.mx-title { font-weight: 600; font-size: 13.5px; margin-bottom: 14px; }
.mx-plot { display: grid; grid-template-columns: 16px 1fr; grid-template-rows: auto 1fr; column-gap: 10px; row-gap: 8px; }
.mx-ylab { grid-column: 1; grid-row: 2; writing-mode: vertical-rl; transform: rotate(180deg); align-self: center; justify-self: center; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); }
.mx-grid { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.mx-xlab { grid-column: 2; grid-row: 1; text-align: center; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); }
.mx-cell { aspect-ratio: 1 / 1; border-radius: 4px; }
.mx-cell.s0 { background: var(--surface-2); border: 1px solid var(--border); }
.mx-cell.s2 { border: 1px solid var(--border); background-color: var(--surface); background-image: repeating-linear-gradient(135deg, transparent 0 3px, var(--border) 3px 4px); }
.mx-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; font-size: 11px; color: var(--ink-3); }
.mx-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mx-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.mx-legend i.k0 { background: var(--surface-2); border: 1px solid var(--border); }
.mx-legend i.k2 { border: 1px solid var(--border); background-color: var(--surface); background-image: repeating-linear-gradient(135deg, transparent 0 3px, var(--border) 3px 4px); }

/* principles */
.about-principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 40px 0 8px; border-top: 1px solid var(--border); }
@media (max-width: 760px){ .about-principles { grid-template-columns: 1fr; } }
.about-card { border: 1px solid var(--border); border-radius: 14px; padding: 22px; background: var(--surface); }
.about-card .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; margin-bottom: 15px; }
.about-card .ic svg { width: auto; height: 22px; }
.about-card h4 { margin: 0 0 7px; font-size: 16px; font-weight: 600; }
.about-card p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.58; }

/* ---------- genome browser (igv.js arcs) ---------- */
.gb-panel { margin: 0 0 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.gb-head { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.gb-head .gb-ico { color: var(--accent); display: grid; place-items: center; flex: none; }
.gb-head .gb-tl { font-size: 14px; font-weight: 600; color: var(--ink); }
.gb-head .gb-sub { font-size: 12.5px; color: var(--ink-3); }
.gb-body { }
.gb-msg { padding: 22px 18px; font-size: 13px; color: var(--ink-3); }
.gb-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.gb-select { font-family: var(--sans); font-size: 13px; color: var(--ink); border: 1px solid var(--border-strong); border-radius: 7px; padding: 6px 10px; background: var(--surface); cursor: pointer; min-width: 160px; }
.gb-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gb-showall { font-family: var(--sans); font-size: 12.5px; color: var(--accent); border: 1px solid var(--border-strong); border-radius: 7px; padding: 6px 11px; background: var(--surface); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.gb-showall:hover { background: var(--accent-soft); border-color: var(--accent); }
.gb-linkctl { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.gb-num { width: 78px; font-family: var(--mono); font-size: 12.5px; color: var(--ink); border: 1px solid var(--border-strong); border-radius: 7px; padding: 6px 8px; background: var(--surface); }
.gb-num:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gb-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-left: auto; font-size: 12px; color: var(--ink-2); }
.gb-key { display: inline-flex; align-items: center; gap: 6px; }
.gb-key i { width: 18px; height: 4px; border-radius: 2px; display: inline-block; }
.gb-hint { color: var(--ink-3); }
.gb-igv { padding: 8px 10px 12px; min-height: 100px; }
/* hide the interact track's 0–1000 value axis (arc height still encodes evidence count) */
.gb-igv .igv-axis-column canvas { visibility: hidden; }

/* arc click popover (rendered inside igv's popover DOM) */
.gb-pop { font-family: var(--sans); min-width: 200px; padding: 1px; }
.gb-pop-row { display: flex; align-items: baseline; gap: 14px; justify-content: space-between; padding: 2px 1px; }
.gb-pop-row > span { color: var(--ink-3); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.gb-pop-row > b { color: var(--ink); font-weight: 600; font-size: 12.5px; text-align: right; }
.gb-pop-row .mono { font-family: var(--mono); font-weight: 500; }
.gb-pop-of { color: var(--ink-3); font-weight: 400; font-size: 11px; }
.gb-pop-cats { font-size: 12px; font-weight: 600; padding: 6px 1px 2px; margin-top: 5px; border-top: 1px solid var(--border); }
.gb-pop-ev { font-size: 11.5px; color: var(--ink-2); line-height: 1.5; padding: 4px 1px 0; }
.gb-pop-open { display: inline-block; margin-top: 9px; font-size: 12px; font-weight: 600; color: var(--accent); text-decoration: none; cursor: pointer; }
.gb-pop-open:hover { text-decoration: underline; }
.gb-pop-card { position: absolute; z-index: 9999; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 14px 40px rgba(0,0,0,.2); padding: 11px 13px; min-width: 200px; max-width: 300px; max-height: min(70vh, 440px); overflow-y: auto; }
.gb-pop-x { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border: none; background: transparent; color: var(--ink-3); font-size: 18px; line-height: 1; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.gb-pop-x:hover { background: var(--surface-2); color: var(--ink); }
.gb-pop-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); padding: 0 24px 7px 0; margin-bottom: 5px; border-bottom: 1px solid var(--border); }

/* ============================================================
   Mobile / phone — scoped so the desktop layout is untouched
   ============================================================ */
@media (max-width: 760px){
  /* top bar wraps: nav + search drop to a full-width second row */
  .topbar { height: auto; min-height: 56px; padding: 8px 14px; flex-wrap: wrap; gap: 8px 12px; }
  .topbar .topbar-right { width: 100%; margin-left: 0; gap: 8px; flex-wrap: wrap; align-items: stretch; }
  .top-search { width: 100%; }
  .searchbox-wrap.compact { width: 100%; max-width: none; }
  .nav { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { height: 0; }

  /* tighter page paddings */
  .page { padding: 16px 14px 64px; }
  .docs { padding: 24px 16px 72px; }
  .home { padding: 0 16px 64px; }

  /* results table: scroll sideways instead of crushing all the columns */
  .tablewrap { overflow-x: auto; }
  table.results { min-width: 720px; }

  /* evidence matrix: narrow the sticky tissue label, drop the inline bar,
     and give cells a readable min so the grid scrolls instead of vanishing */
  :root { --matrix-label: 150px; --cell-min: 26px; }
  .hg-rowlabel { grid-template-columns: 1fr auto; gap: 7px; padding: 0 8px 0 10px; }
  .hg-rowlabel .tbar { display: none; }
  .hg-colname { height: 100px; }

  .subject { padding: 14px 14px; }
}

/* phones (≤ 560px) */
@media (max-width: 560px){
  .home-hero { min-height: 0; padding: 30px 0 10px; }
  .home h1 { font-size: 33px; }
  .home .lede { font-size: 15px; }
  .home .searchbox { height: 56px; }
  .home .searchbox input { font-size: 16px; }
  .stats { flex-wrap: wrap; gap: 16px 0; margin-top: 32px; padding-top: 26px; }
  .stat { padding: 0 16px; }
  .stat:not(:last-child)::after { display: none; }
  .notfound h2 { font-size: 27px; }
  .notfound p { font-size: 15px; }
  .docs h1 { font-size: 27px; }
}
