/* ══════════════════════════════════════════════════════════════════════
   gene.css — /gene/<symbol>

   Loads after lyfe-editorial.css. Light theme only, like every page that
   carries body.lyfe-editorial.

   Classification colour on this page is a DIVERGING scale, because the
   five calls are ordered: blue pole (benign) → neutral gray (VUS) → red
   pole (pathogenic). Values validated for CVD and normal-vision separation
   between neighbours on white (dataviz validate_palette.js). The two light
   steps (LB, LP) sit under 3:1 contrast, so every use is paired with a text
   label, and in the atlas with a lane position as well.

   The site's .tag-B/.tag-LB greens are not used here: green against the
   gray midpoint fails the colour-blind check. Text stays in text inks;
   the coloured dot beside it carries the identity.
   ══════════════════════════════════════════════════════════════════════ */

.gx-page {
  --gx-B:   #1D5C8F;
  --gx-LB:  #4FA3DB;
  --gx-VUS: #6B7380;
  --gx-LP:  #E5772F;
  --gx-P:   #A8222F;
  --gx-UNK: #B4BEC6;

  --gx-ink:    #132D3B;
  --gx-ink-2:  #405D6B;
  --gx-ink-3:  #617A87;
  --gx-line:   #CFDEDF;
  --gx-hair:   #E1EAEB;
  --gx-accent: #28768B;
  --gx-card:   #FFFFFF;
  --gx-mono:   'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

.gx-c-B   { background: var(--gx-B);   --c: var(--gx-B);   }
.gx-c-LB  { background: var(--gx-LB);  --c: var(--gx-LB);  }
.gx-c-VUS { background: var(--gx-VUS); --c: var(--gx-VUS); }
.gx-c-LP  { background: var(--gx-LP);  --c: var(--gx-LP);  }
.gx-c-P   { background: var(--gx-P);   --c: var(--gx-P);   }
.gx-c-UNK { background: var(--gx-UNK); --c: var(--gx-UNK); }

.gx-mono { font-family: var(--gx-mono); }
.gx-dot  { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ── Hero ─────────────────────────────────────────────────────────────── */
body.lyfe-editorial .gx-title {
  font-family: var(--gx-mono);
  font-size: clamp(44px, 6vw, 72px);
  letter-spacing: -.04em;
  line-height: 1;
  margin-bottom: 18px;
}
.gx-strip {
  position: relative;
  display: flex; gap: 2px;
  height: 6px; margin-top: 18px; max-width: 520px;
  border-radius: 4px; overflow: hidden;
}
.gx-strip i { display: block; min-width: 4px; }

/* ── Section furniture ────────────────────────────────────────────────── */
body.lyfe-editorial .gx-sec { margin-top: 38px; }
body.lyfe-editorial .gx-sec + .gx-sec { margin-top: 44px; padding-top: 36px; }
.gx-kicker {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
  font: 700 11px/1.4 var(--gx-mono); letter-spacing: .09em; text-transform: uppercase;
  color: #2B7088;
}
.gx-kicker span {
  display: inline-grid; place-items: center;
  min-width: 26px; height: 20px; padding: 0 5px;
  border: 1px solid #B8D3DB; border-radius: 6px; background: #E9F3F4;
  letter-spacing: 0;
}
body.lyfe-editorial .gx-h2 {
  font-size: clamp(22px, 2.4vw, 29px); font-weight: 750; letter-spacing: -.03em;
  line-height: 1.2; color: #142E3D;
}
.gx-h2 strong { color: var(--gx-accent); font-family: var(--gx-mono); font-weight: 700; letter-spacing: -.02em; }

/* ── 01 Background ────────────────────────────────────────────────────── */
.gx-about {
  display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr);
  gap: clamp(22px, 4vw, 48px); align-items: start;
}
.gx-summary {
  margin-top: 14px; max-width: 72ch;
  font-size: 16px; line-height: 1.75; color: var(--gx-ink-2);
}
.gx-summary::first-letter { color: var(--gx-ink); }
.gx-summary.is-empty { font-size: 15px; color: var(--gx-ink-3); }
.gx-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 20px; }
.gx-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid #BED3D8; background: #FFFFFF;
  font-size: 12.5px; font-weight: 700; color: #195D76; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.gx-links a:hover { background: #EDF6F6; border-color: #9FC6D2; }

.gx-facts {
  padding: 18px 20px; border: 1px solid var(--gx-line); border-radius: 14px;
  background: var(--gx-card); box-shadow: 0 10px 28px -27px rgba(20, 46, 57, .28);
}
.gx-facts h3 {
  margin-bottom: 6px;
  font: 700 11px/1.4 var(--gx-mono); letter-spacing: .09em; text-transform: uppercase; color: #577884;
}
.gx-facts dl > div { padding: 11px 0; border-bottom: 1px solid var(--gx-hair); }
.gx-facts dl > div:last-child { border-bottom: none; padding-bottom: 0; }
.gx-facts dt { font-size: 12px; font-weight: 700; color: var(--gx-ink-3); margin-bottom: 2px; }
.gx-facts dd { font-size: 14px; color: var(--gx-ink); line-height: 1.5; }
.gx-facts dd small { color: var(--gx-ink-3); font-size: 12px; }
.gx-facts a { color: #195F79; text-decoration-color: #B8D3DB; text-underline-offset: 3px; }
.gx-facts a:hover { text-decoration-color: currentColor; }
.gx-conds { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.gx-conds small {
  display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 4px;
  background: #EEF5F5; font-size: 11px; font-weight: 600; color: #456774;
}

/* ── 02 Atlas ─────────────────────────────────────────────────────────── */
.gx-atlas {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
  gap: 18px; align-items: start;
}
.gx-ring-card {
  position: relative; margin: 0;
  padding: 16px 18px 14px;
  border: 1px solid var(--gx-line); border-radius: 16px;
  background:
    radial-gradient(circle at 50% 47%, #F3F8F8 0, #FFFFFF 62%);
  box-shadow: 0 14px 34px -30px rgba(20, 46, 57, .32);
}
.gx-ring-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  min-height: 30px;
}
.gx-ring-meta { font: 500 12px/1.4 var(--gx-mono); color: var(--gx-ink-3); }
.gx-ring-meta b { color: var(--gx-ink); font-weight: 700; }
.gx-ring-pick select {
  font: 600 12px var(--gx-mono); color: var(--gx-ink);
  padding: 5px 26px 5px 10px; border-radius: 8px;
  border: 1px solid #BBCFD4; background: #FFFFFF;
}
.gx-ring {
  position: relative; width: 100%; max-width: 640px; margin: 2px auto 0;
  aspect-ratio: 1 / 1;
}
.gx-ring svg { display: block; width: 100%; height: 100%; overflow: visible; }
.gx-ring-note { min-height: 0; text-align: center; font-size: 13px; color: var(--gx-ink-3); }
.gx-ring-note:not(:empty) { margin: 4px 0 6px; }
.gx-ring-note a { color: #195F79; font-weight: 700; }

/* Skeleton while the gene structure loads: the ring's footprint, no words. */
.gx-ring.is-loading::before {
  content: ''; position: absolute; inset: 18%;
  border-radius: 50%; border: 14px solid #EDF3F3;
}
@media (prefers-reduced-motion: no-preference) {
  .gx-ring.is-loading::before { animation: gx-breathe 1.6s ease-in-out infinite; }
}
@keyframes gx-breathe { 50% { border-color: #E1ECEC; } }

/* SVG parts — drawn by gene-atlas.js. */
.gx-svg .gx-lane     { fill: none; stroke: #DDE7E8; stroke-width: 1; stroke-dasharray: 2 4; }
.gx-svg .gx-lane-lbl { font: 700 9.5px var(--gx-mono); fill: var(--gx-ink-3); }
.gx-svg .gx-end-lbl  { font: 700 11px var(--gx-mono); fill: var(--gx-ink-2); }
.gx-svg .gx-backbone { fill: none; stroke: #B5C6CB; stroke-width: 1.2; }
.gx-svg .gx-exon      { fill: #23404F; transition: fill .12s; }
.gx-svg .gx-exon.alt  { fill: #567684; }
.gx-svg .gx-exon.utr  { fill: #A9BDC4; }
.gx-svg .gx-exon-g:hover .gx-exon,
.gx-svg .gx-exon-g.is-hl .gx-exon { fill: var(--gx-accent); }
.gx-svg .gx-exon-num  { font: 700 8.5px var(--gx-mono); fill: #FFFFFF; pointer-events: none; }
.gx-svg .gx-exon-tick { font: 600 9px var(--gx-mono); fill: var(--gx-ink-3); pointer-events: none; }

.gx-svg .gx-stem { stroke: var(--c); stroke-width: 1; opacity: .55; }
.gx-svg .gx-mark { fill: var(--c); stroke: #FFFFFF; stroke-width: 1.6; paint-order: stroke; }
.gx-svg .gx-mark.is-hollow { fill: #FFFFFF; stroke: var(--c); stroke-width: 2.2; }
.gx-svg .gx-hit  { fill: transparent; }
.gx-svg .gx-halo { fill: none; stroke: var(--gx-accent); stroke-width: 2; opacity: 0; }
.gx-svg .gx-pin { cursor: pointer; outline: none; transition: opacity .15s; }
.gx-svg .gx-pin:hover .gx-halo,
.gx-svg .gx-pin:focus-visible .gx-halo,
.gx-svg .gx-pin.is-hl .gx-halo { opacity: 1; }
.gx-svg .gx-stem.is-hl { opacity: 1; stroke-width: 1.6; }
.gx-svg .gx-pin.is-dim { opacity: .12; }
.gx-svg .gx-pin.is-dim .gx-hit { pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .gx-svg .gx-pins, .gx-svg .gx-stems { animation: gx-fade .5s ease-out both; }
  .gx-svg .gx-pins { animation-delay: .08s; }
}
@keyframes gx-fade { from { opacity: 0; } }
.gx-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.gx-svg .gx-donut     { stroke: #FFFFFF; stroke-width: 2; cursor: default; }
.gx-svg .gx-donut-bg  { fill: none; stroke: #EDF3F3; }
.gx-svg .gx-ctr-sym   { font: 800 40px var(--gx-mono); fill: var(--gx-ink); letter-spacing: -.04em; }
.gx-svg .gx-ctr-n     { font: 700 13px 'Plus Jakarta Sans', system-ui, sans-serif; fill: var(--gx-ink-2); }
.gx-svg .gx-ctr-tx    { font: 500 10.5px var(--gx-mono); fill: var(--gx-ink-3); }

/* Classification fills on SVG nodes use the same --c the legend does. */
.gx-svg .k-B   { --c: var(--gx-B);   }
.gx-svg .k-LB  { --c: var(--gx-LB);  }
.gx-svg .k-VUS { --c: var(--gx-VUS); }
.gx-svg .k-LP  { --c: var(--gx-LP);  }
.gx-svg .k-P   { --c: var(--gx-P);   }
.gx-svg .k-UNK { --c: var(--gx-UNK); }
.gx-svg .gx-donut.k-B, .gx-svg .gx-donut.k-LB, .gx-svg .gx-donut.k-VUS,
.gx-svg .gx-donut.k-LP, .gx-svg .gx-donut.k-P, .gx-svg .gx-donut.k-UNK { fill: var(--c); }

.gx-tip {
  position: absolute; z-index: 30; pointer-events: none;
  min-width: 180px; max-width: 280px;
  padding: 10px 13px; border-radius: 10px;
  border: 1px solid #C9DADD; background: #FFFFFF;
  box-shadow: 0 12px 30px -10px rgba(15, 40, 52, .28);
  font-size: 12.5px; line-height: 1.5; color: var(--gx-ink-2);
}
.gx-tip .h { display: block; font: 700 12.5px var(--gx-mono); color: var(--gx-ink); }
.gx-tip .p { display: block; font: 500 11.5px var(--gx-mono); color: var(--gx-ink-3); }
.gx-tip .c { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-weight: 700; color: var(--gx-ink); }
.gx-tip .s { color: var(--gx-ink-3); font-size: 11.5px; }

.gx-shapes {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--gx-hair);
  font-size: 12px; color: var(--gx-ink-2);
}
.gx-shapes span { display: inline-flex; align-items: center; gap: 6px; }
.gx-shapes svg { width: 13px; height: 13px; fill: #4C6B79; }
.gx-shapes svg .is-hollow { fill: #FFFFFF; stroke: #4C6B79; stroke-width: 2; }
.gx-shapes .gx-shapes-note { margin-left: auto; font-size: 11.5px; color: var(--gx-ink-3); }

/* Side column */
.gx-side { display: flex; flex-direction: column; gap: 14px; }
.gx-card {
  padding: 16px 18px; border: 1px solid var(--gx-line); border-radius: 14px;
  background: var(--gx-card); box-shadow: 0 10px 28px -27px rgba(20, 46, 57, .28);
}
.gx-card h3 { font-size: 15px; font-weight: 750; color: var(--gx-ink); letter-spacing: -.01em; }
.gx-card-sub { margin: 3px 0 12px; font-size: 12.5px; line-height: 1.5; color: var(--gx-ink-3); }

.gx-mix { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.gx-mix li {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) 28px;
  grid-template-areas: "dot lbl n" ". bar p";
  column-gap: 9px; row-gap: 4px; align-items: center;
}
.gx-mix .gx-dot { grid-area: dot; }
.gx-mix-l { grid-area: lbl; font-size: 13.5px; font-weight: 600; color: var(--gx-ink); }
.gx-mix-n { grid-area: n; text-align: right; font: 700 13px var(--gx-mono); color: var(--gx-ink); }
.gx-mix-bar { grid-area: bar; height: 5px; border-radius: 3px; background: #EEF3F4; overflow: hidden; }
.gx-mix-bar i { display: block; height: 100%; border-radius: 3px; }
.gx-mix-p { grid-area: p; text-align: right; font: 500 11px var(--gx-mono); color: var(--gx-ink-3); }
.gx-mix li.is-zero { opacity: .45; }

.gx-lanekey {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--gx-hair);
  font-size: 11.5px; color: var(--gx-ink-3);
}
.gx-lanekey b { color: var(--gx-ink-2); font-weight: 700; }
.gx-lanekey svg { width: 46px; height: 8px; fill: none; stroke: #8FA6AF; stroke-width: 1.4; }

.gx-crit { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.gx-crit li {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 46px;
  gap: 10px; align-items: center;
}
.gx-crit-code { font: 700 12px var(--gx-mono); color: var(--gx-ink); }
.gx-crit-bar { height: 10px; border-radius: 3px; background: #F0F4F5; overflow: hidden; }
.gx-crit-bar i { display: block; height: 100%; min-width: 3px; border-radius: 0 3px 3px 0; }
.gx-crit-bar i.is-p { background: var(--gx-P); }
.gx-crit-bar i.is-b { background: var(--gx-B); }
.gx-crit-n { text-align: right; font: 700 12px var(--gx-mono); color: var(--gx-ink); }
.gx-crit-n small { font-weight: 500; color: var(--gx-ink-3); }
.gx-critkey { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 11.5px; color: var(--gx-ink-3); }
.gx-critkey span { display: inline-flex; align-items: center; gap: 6px; }
.gx-critkey i { width: 10px; height: 10px; border-radius: 2px; }
.gx-critkey i.is-p { background: var(--gx-P); }
.gx-critkey i.is-b { background: var(--gx-B); }

/* ── 03 Queries ───────────────────────────────────────────────────────── */
.gx-table .vth,
.gx-table .vtr {
  grid-template-columns: minmax(150px, 1.15fr) 120px 118px 170px minmax(140px, 1fr) 96px;
  min-width: 880px;
}
.gx-table .vtr { position: relative; }
.gx-table .vtr.is-hl { background: #EAF4F5; box-shadow: inset 3px 0 0 var(--gx-accent); }
body.lyfe-editorial .gx-table .vt-hgvs { color: #1C3E4F; font-weight: 600; }
.gx-loc { font-size: 12.5px; color: var(--gx-ink-2); line-height: 1.35; }
.gx-loc small { display: block; font-size: 11.5px; color: var(--gx-ink-3); }
.gx-cls { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--gx-ink); }
.gx-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.gx-chip {
  display: inline-flex; align-items: baseline;
  padding: 1px 6px; border-radius: 4px; border: 1px solid;
  font: 700 11px/1.5 var(--gx-mono); color: var(--gx-ink);
}
.gx-chip small { font-size: 9.5px; font-weight: 600; color: var(--gx-ink-3); }
.gx-chip.is-p { background: #FBF1F1; border-color: #EBCBCD; }
.gx-chip.is-b { background: #EEF4FA; border-color: #C5D8EA; }
.gx-none { color: var(--gx-ink-3); }
.gx-date { font: 500 11.5px var(--gx-mono); color: var(--gx-ink-3); white-space: nowrap; }
.gx-page .repo-filter i { width: 8px; height: 8px; }
.gx-page .repo-filter small { font: 600 10.5px var(--gx-mono); opacity: .7; }
.gx-more { margin-top: 16px; font-size: 13.5px; }
.gx-more a { color: #195F79; font-weight: 700; text-decoration: none; }
.gx-more a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .gx-atlas { grid-template-columns: 1fr; }
  .gx-side { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  .gx-about { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  /* SVG text is in viewBox units, so it shrinks with the ring on a phone. */
  .gx-svg .gx-ctr-n    { font-size: 19px; }
  .gx-svg .gx-ctr-tx   { font-size: 15px; }
  .gx-svg .gx-lane-lbl { font-size: 12.5px; }
  .gx-svg .gx-end-lbl  { font-size: 15px; }
  .gx-svg .gx-exon-tick{ font-size: 13px; }
  .gx-side { grid-template-columns: 1fr; }
  .gx-ring-card { padding: 12px 10px 12px; }
  .gx-shapes .gx-shapes-note { margin-left: 0; flex-basis: 100%; }
  /* Table collapses to variant + classification, as repo.css does. */
  .gx-table .vth, .gx-table .vtr { grid-template-columns: minmax(0, 1fr) 150px; min-width: 0; }
  .gx-table .vth > :nth-child(2), .gx-table .vtr > :nth-child(2),
  .gx-table .vth > :nth-child(3), .gx-table .vtr > :nth-child(3),
  .gx-table .vth > :nth-child(5), .gx-table .vtr > :nth-child(5),
  .gx-table .vth > :nth-child(6), .gx-table .vtr > :nth-child(6) { display: none; }
  /* repo.css hides column 4 at this width; here it is the classification. */
  .gx-table .vth > :nth-child(4), .gx-table .vtr > :nth-child(4) { display: block; }
}