/* Kandinsky look: Inter and Space Mono (Kandinsky's --font-sans and --font-mono), Valius teal and purple. */
:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--text);background:var(--bg);font-synthesis:none;color-scheme:light;
  --tumor:#6a17d6;--non-tumor:#41618f;
  --tumor-ramp:linear-gradient(to right,#bb92f5,#9a5cf0,#6a17d6);--non-tumor-ramp:linear-gradient(to right,#a3b5cf,#7590b6,#41618f);
  --mono:"Space Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  --teal:#00b8d4;--purple:#c17eff;
  --text:#1a0b2c;--muted:#5d5a70;--faint:#77748a;--status:#4d4a66;--link:#365979;--accent:#0095ad;--accent-text:#0b4f8a;--bar:#4377b4;
  --bg:#f6f5fa;--page:linear-gradient(160deg,#f1ecfb 0%,#f6f5fa 45%,#eef3f8 100%);--surface:#ffffff;--field:#ffffffb3;--switch-bg:#1a0b2c0d;--th-bg:#fafafd;--row-alt:#f7f6fb;--selected:#ece6fa;--hover:#1a0b2c0d;
  --switch-on:#1a0b2c14;--chip-bg:#e6f0fb;--chip-hover:#dcebf9;--map-bg:#fbfcfd;--overlay:#fffffff0;--border:#1a0b2c1f;--border-soft:#1a0b2c14;--border-strong:#1a0b2c33;
  --accent-border:#a9c5e4;--ramp:linear-gradient(to right,#eef4fb,#73a9dd,#0b3d91);--meter-track:#1a0b2c14;--dapi-filter:invert(1);--dapi-opacity:.64}
/* Dark theme (the default): set on <html> from the saved choice. */
:root[data-theme=dark]{color-scheme:dark;
  --tumor:#c47aff;--non-tumor:#b4c9e6;
  --tumor-ramp:linear-gradient(to right,#5b21c4,#9446f5,#c47aff);--non-tumor-ramp:linear-gradient(to right,#4b6287,#7690b8,#b4c9e6);
  --text:#eceefa;--muted:#a3a7c2;--faint:#80859f;--status:#a3b1d6;--link:#8cc4ff;--accent:#00b8d4;--accent-text:#9ccdff;--bar:#5aa2ea;
  --bg:#0f1330;--page:radial-gradient(120% 80% at 0% 0%,#211340 0%,#161538 35%,transparent 70%),linear-gradient(170deg,#141434 0%,#0e1330 55%,#0c1230 100%);
  --surface:#151a3a;--field:#ffffff08;--switch-bg:#ffffff0f;--th-bg:#181d3f;--row-alt:#181d3f;--selected:#262c5a;--hover:#ffffff0f;
  --switch-on:#ffffff1a;--chip-bg:#1c2c52;--chip-hover:#24395a;--map-bg:#080b20;--overlay:#151a3af0;--border:#ffffff1f;--border-soft:#ffffff14;--border-strong:#ffffff2e;
  --accent-border:#2f5f94;--ramp:linear-gradient(to right,#3474c8,#74b0f0,#f2f8ff);--meter-track:#ffffff1f;--dapi-filter:none;--dapi-opacity:.5}
*{box-sizing:border-box}html{background:var(--bg)}body{margin:0;min-height:100vh;background:var(--page);background-attachment:fixed}
button,input,select{font:inherit;color:inherit}button,select,input[type=range],input[type=checkbox]{cursor:pointer}
button:focus-visible,input:focus-visible,select:focus-visible,#stage:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
[hidden]{display:none!important}h1,h2,p{margin:0}p,small{color:var(--muted)}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.icon{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round}

/* Top bar: viewer and publisher links, sample picker, sources, and theme toggle. */
header,main{max-width:1780px;margin:auto;padding-inline:clamp(16px,4vw,56px)}
/* The top bar stays pinned while the page scrolls. It spans the full width and paints the page gradient at viewport size from
   its own corner, which is the viewport's, so it matches the page behind it. It sits above page content; the gene pop-up and
   its backdrop are in the top layer, over it. */
html{--header-h:68px;scroll-padding-top:var(--header-h)}
header{display:flex;align-items:center;justify-content:space-between;gap:12px;height:var(--header-h);position:sticky;top:0;z-index:30;max-width:none;
  padding-inline:max(clamp(16px,4vw,56px),calc((100% - 1780px)/2 + clamp(16px,4vw,56px)));background:var(--page);background-color:var(--bg);background-size:100% 100vh;background-repeat:no-repeat;border-bottom:1px solid transparent}
/* A hairline under the bar once the page has scrolled, where the browser can tie it to scrolling. */
@supports(animation-timeline:scroll()){header{animation:header-edge linear both;animation-timeline:scroll(root);animation-range:0 24px}}
@keyframes header-edge{to{border-bottom-color:var(--border-soft)}}
.brand{display:flex;align-items:center;gap:12px}.brand img{width:22px;height:22px}:root[data-theme=dark] .brand img{filter:invert(1)}
.brand strong{font-size:17px;font-weight:600;letter-spacing:-.02em}
.top-tools{display:flex;align-items:center;gap:12px}
.section-picker{display:flex;align-items:center;gap:12px;font-size:14px;color:var(--muted)}.section-picker select{min-width:164px;font-weight:500}
select{height:42px;padding:0 36px 0 14px;border:1px solid var(--border-strong);border-radius:6px;background:var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%239aa0bb' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 6.5 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") no-repeat right 12px center/16px;appearance:none;color:var(--text);font-size:14px}
select option{background:var(--surface);color:var(--text)}
.theme-toggle{display:grid;place-items:center;width:42px;height:42px;border:1px solid var(--border-strong);border-radius:50%;background:var(--field);color:var(--text)}.theme-toggle:hover{background:var(--hover)}

/* Display title and its gradient rule, then the view tabs with their tools. */
main{padding-top:clamp(13px,2.3vw,28px);padding-bottom:48px}
/* The title with the page tabs on its right, over the gradient rule. */
.title-row{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 24px;margin-bottom:22px;padding-bottom:clamp(14px,1.7vw,22px);background:linear-gradient(90deg,var(--purple),var(--teal)) bottom/100% 2px no-repeat}
h1{font-size:clamp(38px,4.8vw,70px);font-weight:200;letter-spacing:-.04em;line-height:1.08}
h2{font-size:17px;font-weight:500;letter-spacing:-.02em}
.tabs{display:flex;gap:6px}.tabs button{position:relative;border:0;background:none;padding:12px 10px 14px;font-size:15px;color:var(--muted)}
.tabs button:first-child{padding-left:2px}.tabs button:hover{color:var(--text)}
.tabs [aria-pressed=true]{color:var(--text);font-weight:500}.tabs [aria-pressed=true]:after{content:"";position:absolute;left:10px;right:10px;bottom:4px;height:2px;border-radius:1px;background:var(--text)}
.tabs button:first-child:after{left:2px}.tabs button:last-child{padding-right:2px}.tabs button:last-child:after{right:2px}
/* Each page's search and sort sit at the right of its pill row. */
/* One unit that never splits: the search box shrinks before the unit leaves the pill row. */
.tools{flex:1 1 0;display:flex;align-items:center;justify-content:flex-end;gap:16px;margin-left:auto;padding-left:20px;font-size:14px;color:var(--muted)}.tools label{flex:none;display:flex;align-items:center;gap:10px;white-space:nowrap}
#gallery-sort{width:176px;font-weight:500}
/* On laptop widths the tier pills, when shown, take their own row under the gene sets, so the search and sort keep the first. */
@media(min-width:1061px) and (max-width:1380px){#gallery-view .tier-switch{order:2;flex-basis:100%;margin-left:0;padding-left:0;border-left:0}}
.search{display:flex;align-items:center;gap:10px;padding:0 14px;height:42px;border:1px solid var(--border-strong);background:var(--field);border-radius:6px;color:var(--muted)}
.search input{width:100%;border:0;background:transparent;outline:none;font-size:14px;color:var(--text)}.search input::placeholder{color:var(--muted)}
.gene-field{position:relative}.gallery-filter{flex:0 1 280px;min-width:160px}
/* The gene searches: an outlined field with the magnifier inside, ringed in teal while in use. */
:is(.tools,.viewer-head) .search{gap:9px;padding:0 13px;border-radius:8px;cursor:text;transition:border-color .15s,box-shadow .15s}
:is(.tools,.viewer-head) .search:hover{border-color:color-mix(in srgb,var(--text) 34%,transparent)}
:is(.tools,.viewer-head) .search:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 22%,transparent);color:var(--text)}
:is(.tools,.viewer-head) .search input{min-width:0;padding:0}:is(.tools,.viewer-head) .search input:focus-visible{outline:none}
.viewer-head .matches{right:0}
.matches{position:absolute;z-index:8;top:100%;margin-top:4px;background:var(--surface);border:1px solid var(--border);box-shadow:0 12px 32px #0007;border-radius:8px;padding:4px;width:max(100%,280px);max-height:300px;overflow:auto}
.matches button{display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;text-align:left;border:0;background:none;padding:7px 10px;border-radius:5px;color:var(--text)}
.matches button[aria-selected=true],.matches button:hover{background:var(--hover)}.matches .empty{padding:8px;font-size:14px;color:var(--muted)}.matches .gene-name{font-weight:500}
/* The one status line, under the current view's controls; gone while nothing loads. */
#status{font-size:13px;color:var(--status);padding:0 2px 12px}#status:empty{display:none}

/* Pill rows: gene set and tier on the left, gene count and map key on the right. */
.chip-row{display:flex;flex-wrap:wrap;align-items:center;gap:12px 0;margin:28px 0 30px}
.pills{display:flex;align-items:center;gap:2px}.pills button{border:0;background:none;border-radius:999px;padding:11px 14px;font-size:14px;color:var(--muted)}.pills button:hover{color:var(--text)}
.pills [aria-pressed=true]{background:var(--switch-on);color:var(--text);font-weight:500}
.pills+.pills{margin-left:20px;padding-left:20px;border-left:1px solid var(--border-strong)}
.tier-switch [aria-pressed=true]:is(.t1,.t2,.t3){background:color-mix(in srgb,var(--tier) 20%,transparent);color:var(--tier-text)}
.gallery-key{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:8px 20px;margin:-16px 0 22px;font-size:12px;color:var(--muted)}.gallery-key span{display:inline-flex;align-items:center;gap:7px}
#gallery-legend{flex-wrap:wrap;gap:6px 14px}.gallery-key .gallery-count{gap:.3em;font-variant-numeric:tabular-nums}.gallery-count b{color:var(--text);font-weight:500}
.dot{width:8px;height:8px;border-radius:50%;display:inline-block;flex:none}
.ramp{width:94px;height:4px;border-radius:2px;background:var(--ramp);display:inline-block;margin:0 2px}

/* Gene cards: the map, the name and tier, a hairline, then tumor, non-tumor and fold change columns. */
.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,330px),1fr));gap:44px 38px}
.tile{display:flex;flex-direction:column;min-width:0;padding:0;text-align:left;background:none;border:0;color:var(--text)}
.tile :is(canvas,.prepared-map){width:100%;height:auto;background:var(--map-bg);border:1px solid var(--border-strong);border-radius:10px;transition:border-color .15s}.tile:hover :is(canvas,.prepared-map){border-color:var(--muted)}
.tile-head{display:flex;align-items:center;gap:10px;padding:18px 0 20px;border-bottom:1px solid var(--border)}
/* Display name, then the gene symbol in small muted monospace (not on Tumor heterogeneity). */
.gene-name{display:inline-flex;align-items:baseline;gap:.5em;min-width:0;white-space:nowrap}.gene-name small{font-family:var(--mono);font-size:11px;font-weight:400;letter-spacing:.02em;color:var(--muted)}
.tile-head .gene-name{font-size:31px;font-weight:300;letter-spacing:-.03em;line-height:1.1;gap:12px}.tile-head .gene-name small{font-size:12px}#viewer-title .gene-name{gap:0 14px;flex-wrap:wrap;white-space:normal;line-height:1.1}#viewer-title .gene-name small{font-size:13px}.tile-head .tier{margin-left:auto}
/* Card stats, label | bar | right-aligned monospace value, for Tumor and
   Non-tumor % positive and the fold change. --tumor and --non-tumor come from tissue.js's theme. */
.tile-stats{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:14px 18px;padding-top:20px;font-size:14px;color:var(--muted)}
:is(.tile-stats,.gs-compare) .label{white-space:nowrap;margin-right:6px}
:is(.tile-stats,.gs-compare) b{font-family:var(--mono);font-size:15px;font-weight:400;color:var(--text);text-align:right;white-space:nowrap;min-width:4.5ch}
.meter,.fc-meter{position:relative;display:block;height:6px;border-radius:3px;background:var(--meter-track);overflow:hidden}
.meter i{display:block;height:100%;border-radius:3px}.meter.tumor i,.fc-meter .tumor{background:var(--tumor)}.meter.other i,.fc-meter .other{background:var(--non-tumor)}
.gallery-key .swatch{display:inline-block;width:22px;height:8px;border-radius:4px}.gallery-key .swatch.tumor{background:var(--tumor-ramp)}.gallery-key .swatch.other{background:var(--non-tumor-ramp)}
.fc-meter{overflow:visible}.fc-meter i{position:absolute;top:0;height:100%}.fc-meter .tumor{left:50%;border-radius:0 3px 3px 0}.fc-meter .other{right:50%;border-radius:3px 0 0 3px}
.fc-meter:before{content:"";position:absolute;left:50%;top:-5px;bottom:-5px;border-left:1.5px solid var(--text);opacity:.85;z-index:1}
.stat{display:flex;flex-direction:column;gap:6px;min-width:0;font-size:12px;color:var(--muted)}
.stat b{font-family:var(--mono);font-size:14px;font-weight:400;color:var(--text);white-space:nowrap}.stat .sub{font-family:var(--mono);font-size:13px;color:var(--text);opacity:.82;white-space:nowrap}
/* VAST tiers, outlined: Tier 1 Valius purple, Tier 2 pink, Tier 3 grey. */
.t1{--tier:#7e22ce;--tier-text:#7e22ce}.t2{--tier:#db2777;--tier-text:#be185d}.t3{--tier:#6b7280;--tier-text:#4b5563}
:root[data-theme=dark] .t1{--tier:#c17eff;--tier-text:#d7b1ff}:root[data-theme=dark] .t2{--tier:#f9a8d4;--tier-text:#fbcfe8}:root[data-theme=dark] .t3{--tier:#9ca3af;--tier-text:#d1d5db}
.tier{flex:none;font-size:12px;font-weight:500;line-height:1;padding:5px 10px;border-radius:999px;border:1px solid color-mix(in srgb,var(--tier) 60%,transparent);color:var(--tier-text);background:color-mix(in srgb,var(--tier) 8%,transparent)}
.matches .tier{font-size:11px;padding:3px 7px}
/* Gallery search and multi-select. */
#gallery-matches button[aria-selected=true]{background:none}#gallery-matches button[data-active],#gallery-matches button:hover{background:var(--hover)}
#gallery-matches .pick{width:16px;height:16px;flex:none;border:1px solid var(--border-strong);border-radius:4px;display:inline-grid;place-items:center;font-size:12px;color:white}#gallery-matches [aria-selected=true] .pick{background:var(--accent);border-color:var(--accent)}
#gallery-matches button{justify-content:flex-start}#gallery-matches .tier{margin-left:auto}
.chips{display:flex;flex-wrap:wrap;gap:8px;margin:-18px 0 28px}.chip{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border-strong);background:var(--switch-on);color:var(--text);border-radius:999px;padding:5px 12px;font-size:13px;font-weight:500}.chip:hover{background:var(--hover)}.chips .clear{border:0;background:none;color:var(--link);text-decoration:underline;font-size:13px}
.gallery .empty{color:var(--muted);font-size:14px;padding:12px 0}#gallery-more{height:1px}
.table-hint{font-size:13px;color:var(--muted);padding:0 0 12px}#gallery-progress:empty{display:none}

/* Cards in the gene viewer and the tumor heterogeneity chart. */
.card{background:color-mix(in srgb,var(--surface) 70%,transparent);border:1px solid var(--border);border-radius:14px;overflow:hidden}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 20px}
/* Gene pop-up stats strip: tumor vs. non-tumor bars, Fold change and Top cell types columns between thin
   vertical rules. The comparison takes the cards' bars and values: Tumor over Non-tumor, mean CPM then
   % positive; the fold change a large value over the cards' diverging bar; the top cell types as bars
   in their colors. */
.gene-stats{display:flex;flex-wrap:wrap;align-items:flex-start;gap:20px 0;padding:4px 0 30px}.gene-stats[hidden]{display:none}
.gs-col{flex:none;padding:0 34px;border-left:1px solid var(--border);min-height:62px}.gs-col:first-child{padding-left:0;border-left:0}
.gs-head,.gs-col.stat>span:first-child{font-size:12px;color:var(--muted)}
.gs-compare{flex:0 1 auto;min-width:0;display:grid;grid-template-columns:auto repeat(2,minmax(72px,132px) max-content);align-items:center;gap:12px 14px;font-size:14px;color:var(--muted)}
.gs-compare .gs-head{grid-column:span 2}.gs-compare .cpm{margin-right:14px}
.gene-stats .gs-fc b{font-family:var(--mono);font-size:24px;font-weight:400;line-height:1;color:var(--text);letter-spacing:-.02em;white-space:nowrap}
.gene-stats .gs-fc{gap:12px;width:auto;min-width:230px}.gene-stats .gs-fc .fc-meter{margin:6px 8px 0 0}
.gene-stats .top{flex:1 1 360px;max-width:560px;gap:8px}
.top-types{display:grid;grid-template-columns:auto minmax(80px,1fr) auto;gap:0 18px}
.top-types button{display:grid;grid-template-columns:subgrid;grid-column:1/-1;align-items:center;padding:3px 6px;margin:0 -6px;border:0;border-radius:6px;background:none;color:var(--text);font:inherit;font-size:12.5px;text-align:left;cursor:pointer}
.top-types button:hover{background:var(--hover)}.top-types button[aria-pressed=true]{background:var(--selected)}
.top-types .name{display:flex;align-items:center;gap:9px;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top-types .track{display:block;height:3px;border-radius:2px;background:var(--border)}.top-types .track i{display:block;height:100%;border-radius:2px}
.gene-stats .top-types b{font-family:var(--mono);font-weight:400;font-size:11.5px;color:var(--text);opacity:.85;text-align:right;white-space:nowrap}
/* The table's gear menu: a muted icon button opening a small menu of two radio options. */
.table-options{position:relative}
.gear{display:grid;place-items:center;width:30px;height:30px;padding:0;border:0;border-radius:50%;background:none;color:var(--muted);cursor:pointer}.gear:hover,.gear[aria-expanded=true]{color:var(--text);background:var(--hover)}
.menu{position:absolute;right:0;top:calc(100% + 6px);z-index:20;display:flex;flex-direction:column;min-width:150px;padding:4px;border:1px solid var(--border-strong);border-radius:10px;background:var(--surface);box-shadow:0 8px 24px #0006}.menu[hidden]{display:none}
.menu button{display:flex;align-items:center;gap:8px;padding:7px 10px;border:0;border-radius:6px;background:none;color:var(--text);font:inherit;font-size:13px;text-align:left;cursor:pointer}
.menu button:hover,.menu button:focus-visible{background:var(--hover);outline:none}
.menu button:before{content:"";width:14px;flex:none;text-align:center;color:var(--teal)}.menu button[aria-checked=true]:before{content:"✓"}
.panels{display:grid;grid-template-columns:minmax(0,1.48fr) minmax(360px,1fr);gap:20px;align-items:start}
#stage{height:clamp(380px,52vh,690px);position:relative;overflow:hidden;background:var(--map-bg);touch-action:none;cursor:grab;border-block:1px solid var(--border-soft)}#stage:active{cursor:grabbing}#stage canvas,#stage img{position:absolute;top:0;left:0;pointer-events:none}#stage img{filter:var(--dapi-filter);opacity:var(--dapi-opacity);transform-origin:0 0}#stage canvas{width:100%;height:100%}
.zoom,.scale{position:absolute;bottom:12px;background:var(--overlay);border:1px solid var(--border-strong);border-radius:8px}.zoom{right:12px;display:flex;overflow:hidden}.zoom button{border:0;background:none;padding:5px 10px;font-size:16px}.zoom button:hover{background:var(--hover)}.scale{left:12px;font-size:12px;padding:4px 8px;text-align:center}.scale i{display:block;border:solid var(--text);border-width:0 1px 2px;height:5px}
.map-key{display:flex;flex-wrap:wrap;gap:16px;align-items:center;justify-content:space-between;padding:14px 20px;font-size:12px;color:var(--muted);min-height:48px}.map-key span{display:inline-flex;align-items:center;gap:6px}.map-key label{cursor:pointer}
#legend,#legend label,#legend span{display:flex;align-items:center;flex-wrap:wrap;gap:7px}#legend{gap:12px}#legend .ramp{width:68px}
#legend input{accent-color:var(--teal)}.expression-mark{display:inline-block;width:9px;height:9px;flex:none;border-radius:50%}
#cell-readout{position:absolute;top:10px;left:10px;max-width:90%;padding:6px 10px;background:var(--overlay);border:1px solid var(--border-strong);border-radius:8px;font-size:13px;pointer-events:none}
.table-wrap{overflow:auto;max-height:clamp(290px,43vh,590px)}table{width:100%;border-collapse:collapse;font-size:13px;font-variant-numeric:tabular-nums}
th,td{padding:9px 7px;text-align:right;border-bottom:1px solid var(--border-soft)}th:first-child,td:first-child{text-align:left;padding-left:18px}th:last-child,td:last-child{padding-right:18px}
td+td{font-family:var(--mono);font-size:12.5px}
th{font-size:12px;font-weight:500;background:var(--th-bg);color:var(--muted);position:sticky;top:0;z-index:1}
td:first-child button{display:flex;align-items:center;gap:7px;text-align:left;font-size:13px;border:0;background:transparent;padding:0}
tbody tr{cursor:pointer}tbody tr:hover{background:var(--hover)}.focused{background:var(--selected)}.focused td:first-child{box-shadow:inset 3px 0 var(--accent)}
.rate{display:inline-block;position:relative;padding-bottom:4px}.rate:after{content:"";position:absolute;left:0;bottom:0;height:2px;background:var(--bar);width:var(--share)}
/* Cell groups with their individual types nested underneath. */
#rows tr.group td{background:var(--row-alt);font-weight:500}#rows tr.group.focused td{background:var(--selected)}#rows tr.group td:first-child{display:flex;align-items:center;gap:4px;padding-left:8px}
#rows tr.type td:first-child{padding-left:38px}#rows tr.flat td:first-child{padding-left:18px}
th button{border:0;background:none;padding:0;font:inherit;color:inherit}th button:hover,th[aria-sort]{color:var(--text)}th[aria-sort] button:after{content:" ↓"}th[aria-sort=ascending] button:after{content:" ↑"}
.composition{display:grid;gap:2px;padding:0 12px 14px}.comp-group{display:flex;align-items:center;gap:2px}.comp-group .caret{flex:none}
.comp-row{flex:1;min-width:0;display:grid;grid-template-columns:auto minmax(0,1fr) auto 42px;align-items:center;gap:5px 10px;padding:8px 10px;border:0;border-radius:8px;background:transparent;text-align:left;font-size:14px;color:var(--text)}
.comp-row:hover{background:var(--hover)}.comp-row[aria-pressed=true]{background:var(--selected)}.comp-row .dot{width:10px;height:10px}.comp-group .name{font-weight:500}.comp-row .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.comp-row .count{color:var(--muted);font-family:var(--mono);font-size:12px}.comp-row .pct{text-align:right;font-family:var(--mono);font-size:13px}
:is(.comp-row,.marker-row) .share{grid-column:2/-1;height:3px;border-radius:2px;background:var(--border-soft);position:relative}:is(.comp-row,.marker-row) .share:after{content:"";position:absolute;inset:0 auto 0 0;width:var(--share);background:var(--color);border-radius:2px}
.comp-row.sub{margin-left:26px;padding-left:22px;font-size:13px}.map-card .card-head{flex-wrap:wrap}
/* Cell types: the highlighted population's upregulated genes under Composition, in its rows' style, with
   columns shared by every row and the fold change as a bar in the population's color. */
.type-panels{display:grid;gap:20px;align-content:start}
.markers-why{max-width:68ch;padding:0 20px 14px;font-size:14px;line-height:1.55}
.markers{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto auto;gap:0 14px;padding:0 12px 14px}
.marker-head,.marker-row{display:grid;grid-template-columns:subgrid;grid-column:1/-1;align-items:center}
.marker-head{padding:0 10px 4px;font-size:12px;color:var(--muted)}.markers .num{text-align:right;white-space:nowrap}
.marker-row{row-gap:5px;padding:8px 10px;border:0;border-radius:8px;background:transparent;text-align:left;font-size:14px;color:var(--text);cursor:pointer}
.marker-row:hover{background:var(--hover)}.marker-row .rank{min-width:1.2em;font-family:var(--mono);font-size:11px;color:var(--faint)}
.marker-row .gene-name{overflow:hidden;text-overflow:ellipsis;font-weight:500}
.marker-row .num{font-family:var(--mono);font-size:12.5px}.marker-row .num small{font-size:11px;color:var(--muted)}
.markers .empty{grid-column:1/-1;padding:8px 10px;font-size:14px;color:var(--muted)}
.caret{border:0;background:none;width:24px;height:24px;border-radius:5px;color:var(--muted);transition:transform .15s}.caret:hover{background:var(--hover)}.caret[aria-expanded=false]{transform:rotate(-90deg)}
/* The map and its panels: inline as the Cell types page, a pop-up for a gene opened from the lists. */
#viewer:not(:modal){position:static;width:auto;margin:0;padding:0;border:0;background:none;color:inherit;overflow:visible}#viewer:not(:modal) .viewer-head{display:none}
#viewer:modal{width:min(1600px,calc(100vw - 48px));max-width:none;height:fit-content;max-height:calc(100dvh - 48px);overflow:auto;padding:0 24px 24px;background:var(--bg);color:inherit;border:1px solid var(--border);border-radius:16px;box-shadow:0 24px 80px #0009}
.viewer-head{display:flex;align-items:center;gap:16px;position:sticky;top:0;z-index:12;background:var(--bg);padding:20px 0 16px}.viewer-head .gene-field{flex:0 1 280px;min-width:180px}
/* Up to tablet widths the pop-up's search takes its own full-width row under the title, so long gene names keep their room. */
@media(max-width:960px){.viewer-head{flex-wrap:wrap}#viewer-title{flex:1 1 0}#viewer-status{flex:0 1 auto}.viewer-head .gene-field{order:3;flex-basis:100%}}
#viewer-title{min-width:0;font-size:34px;font-weight:300;letter-spacing:-.035em;white-space:nowrap}
.focus-clear{display:contents}
.clear-chip{display:inline-flex;align-items:center;gap:7px;max-width:100%;padding:4px 8px 4px 11px;border:1px solid var(--border-strong);border-radius:999px;background:var(--field);color:var(--text);font:inherit;font-size:13px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.clear-chip:hover{background:var(--hover)}.clear-chip .x{font-size:16px;line-height:1;color:var(--muted)}.clear-chip:hover .x{color:var(--text)}
.pill-button{border:1px solid var(--border-strong);background:var(--field);border-radius:999px;padding:6px 14px;font-size:13px;color:var(--text)}.pill-button:hover:not(:disabled){background:var(--hover)}.pill-button:disabled{opacity:.45;cursor:default}
/* The gene pop-up, a rounded navy card under a thin purple-to-teal rule, panels
   without boxes, the map with rounded corners and its controls as dark pills. */
:root{--modal-bg:var(--surface);--modal-top:var(--surface);--modal-rule:linear-gradient(90deg,var(--purple),var(--teal));--share-bar:var(--accent)}
:root[data-theme=dark]{--modal-bg:linear-gradient(180deg,#170f34 0%,#121437 42%,#0f1a3e 100%);--modal-top:#170f34;
  --modal-rule:linear-gradient(90deg,#a78bfacc,#67e8f9cc);--share-bar:#8ee6f3}
#viewer:modal{background:var(--modal-bg);border-color:var(--border-soft);border-radius:18px;padding:0 28px 28px}
#viewer:modal .viewer-head{margin:0 -28px;padding:28px 28px 16px;background:var(--modal-rule) top/100% 2px no-repeat,var(--modal-top)}
#viewer:modal #viewer-title{font-size:42px;font-weight:200}
#viewer:modal .panels{gap:44px}
#viewer:modal .card{background:none;border:0;border-radius:0;overflow:visible}
#viewer:modal .card-head{padding:0 0 14px;min-height:44px}#viewer:modal .card-head h2{font-size:15px;font-weight:500}
#viewer:modal #stage{border:1px solid var(--border-soft);border-radius:14px}
#viewer:modal .map-key{padding:12px 0 0;min-height:0}
#viewer:modal .zoom,#viewer:modal .scale{background:#0a0d24d9;border-color:#ffffff1a;border-radius:999px}#viewer:modal .zoom button{padding:7px 14px}
#viewer:modal .table-wrap{max-height:none;overflow:visible}
#viewer:modal th{background:none;position:static;font-weight:400;padding-top:4px}
#viewer:modal :is(th,td):first-child{padding-left:0}#viewer:modal :is(th,td):last-child{padding-right:0}
#viewer:modal td{padding-top:12px;padding-bottom:12px;border-bottom-color:var(--border-soft)}#viewer:modal tr.group td:first-child button{font-weight:500}
#viewer:modal #rows tr.group td{background:none}#viewer:modal #rows tr.group.focused td,#viewer:modal #rows tr.focused td{background:var(--selected)}
#viewer:modal #rows tr.group td:first-child{display:table-cell;padding-left:0;white-space:nowrap}
#viewer:modal #rows td:first-child :is(button,.caret){display:inline-flex;vertical-align:middle}#viewer:modal #rows .caret{align-items:center;justify-content:center;margin-right:6px}
/* Type rows indent by the caret and its margin, so their color dots line up under their group's. */
#viewer:modal #rows tr.type td:first-child{padding-left:30px}#viewer:modal #rows tr.flat td:first-child{padding-left:0}
/* Every row's track has the same width and left edge: the percentage sits in a fixed-width, right-aligned slot a little wider than 100%, so no label's
   subpixel width can move the bar. */
.share-cell{display:inline-flex;align-items:center;gap:14px}.share-cell span{flex:none;width:4.5ch;text-align:right}.share-cell .track{display:block;flex:none;width:52px;height:3px;border-radius:2px;background:var(--border)}
.share-cell .track i{display:block;height:100%;border-radius:2px;background:var(--share-bar)}
.caret .icon{width:14px;height:14px;stroke-width:1.6}
/* Map coloring: a small segmented toggle in the map's header. */
.seg{display:inline-flex;margin-left:auto;padding:2px;border:1px solid var(--border);border-radius:999px}.seg[hidden]{display:none}
.seg button{padding:4px 11px;border:0;border-radius:999px;background:none;color:var(--muted);font:inherit;font-size:12px;cursor:pointer}
.seg button:hover{color:var(--text)}.seg button[aria-pressed=true]{background:var(--switch-on);color:var(--text)}
#legend .type-key{display:inline-flex;align-items:center;gap:6px}
#viewer:focus{outline:none}body:has(#viewer:modal){overflow:hidden}
#viewer::backdrop{background:#05071899;backdrop-filter:blur(2px)}.viewer-head .status{flex:1;font-size:13px;color:var(--status)}
#viewer-close{display:grid;place-items:center;width:32px;height:32px;padding:0;border:0;border-radius:50%;background:none;color:var(--muted)}#viewer-close:hover{color:var(--text);background:var(--hover)}#viewer-close .icon{width:18px;height:18px;stroke-width:1.5}
/* Tumor heterogeneity: one column per tumor cluster, lines joining each gene's ranks. */
/* Tumor heterogeneity sits on the page, with no card around it. */
.hetero-chart{overflow-x:auto;--halo:var(--bg)}.hetero-chart svg{display:block;font-size:13px}.hetero-chart .empty{color:var(--muted);font-size:14px}
.hetero-chart text{fill:var(--text)}.cluster-name{font-weight:600;font-size:15px}.cluster-cells,.rank-label{fill:var(--muted)!important;font-size:12px}
.gene-label{font-weight:500}.hetero-chart .gene-label.middle{display:none}.hetero-chart .entry:is(.hot,:focus-visible) .gene-label.middle{display:inline}.gene-value{font-weight:400;fill:var(--muted)!important;font-family:var(--mono);font-size:12px}
.hetero-chart path{fill:none;stroke-width:2.5;opacity:.8;transition:opacity .15s}.hetero-chart path.dive{opacity:.5}
.hetero-chart .gutter{fill:var(--switch-bg);stroke:none}.hetero-chart .gutter-label{fill:var(--muted)!important;font-size:11px;letter-spacing:.02em}
.hetero-chart .gutter-point{cursor:pointer;transition:opacity .15s}.hetero-chart .gutter-point circle:first-child{opacity:.6}.gutter-note{display:none;font-size:12px;paint-order:stroke;stroke:var(--halo);stroke-width:5px;stroke-linejoin:round}.gutter-point.hot .gutter-note{display:inline}
.hetero-chart .hit{fill:transparent}.hetero-chart .entry text{paint-order:stroke;stroke:var(--halo);stroke-width:5px;stroke-linejoin:round}.hetero-chart .entry{cursor:pointer;outline:none;transition:opacity .15s}
.hetero-chart .entry:focus-visible circle{stroke:var(--teal);stroke-width:3}.hetero-chart svg.focusing [data-gene]:not(.hot){opacity:.12}.hetero-chart path.hot{stroke-width:4;opacity:1}

@media(max-width:960px){.panels{grid-template-columns:1fr}.table-wrap{max-height:none}#stage{height:54vh}.tools{margin-left:0;padding-left:0;justify-content:flex-start;flex-basis:100%}.gallery-key{justify-content:flex-start}}
/* Phones: the upregulated genes drop their rank and mean CPM columns so names fit. */
@media(max-width:560px){.markers{grid-template-columns:minmax(0,1fr) auto auto;gap:0 12px;padding:0 4px 12px}.markers :is(.rank,.cpm){display:none}.marker-row .share{grid-column:1/-1}}
@media(max-width:560px){.gene-stats{display:grid;grid-template-columns:minmax(0,1fr);gap:18px 16px;padding-bottom:20px}.gs-col{padding:0;border-left:0;min-height:0}.gene-stats .gs-fc,.gene-stats .top{max-width:none;min-width:0;padding-top:16px;border-top:1px solid var(--border)}.gs-compare{grid-template-columns:auto repeat(2,minmax(0,1fr) auto);gap:12px}.gs-compare .label{margin-right:0}.gs-compare .cpm{margin-right:6px}.gene-stats .gs-fc b{font-size:21px}.section-picker span{display:none}.section-picker select{min-width:0}
  .tabs{gap:0}.tabs button{padding-inline:8px;font-size:14px}#hetero-metric{max-width:170px}.tools{flex-wrap:wrap;gap:10px 16px}
  .pills+.pills{margin-left:0;padding-left:0;border-left:0}.pills button{padding:9px 12px}
  .card-head{padding:15px 12px}.map-key{padding:12px;gap:6px}td,th{padding:8px 4px}td:first-child,th:first-child{padding-left:8px}td:last-child,th:last-child{padding-right:8px}#stage{height:380px}
  #viewer:modal{width:100vw;height:100dvh;max-height:100dvh;border:0;border-radius:0;padding:0 12px 16px}#viewer:modal .viewer-head{margin:0 -12px;padding:14px 12px 10px}#viewer:modal #viewer-title{font-size:30px}#viewer:modal .panels{gap:28px}.viewer-head{gap:8px;padding:12px 0 10px}#viewer-title{flex:1;font-size:26px;white-space:normal}
  /* Phones: rows that scroll sideways rather than wrap, names that wrap. */
  .tabs{overflow-x:auto;scrollbar-width:none;max-width:100%}.tabs button{white-space:nowrap}
  .chip-row .pills{max-width:100%;overflow-x:auto;scrollbar-width:none}.pills button{white-space:nowrap}
  .tile-head .gene-name{font-size:27px;flex-wrap:wrap;white-space:normal}.stat b{font-size:13px}.stat .sub{font-size:12px}}
/* Touch screens (phones and tablets): tap targets of about 40px. */
@media(pointer:coarse),(max-width:560px){.seg button{min-height:36px;padding:0 13px}.clear-chip{min-height:40px;padding:0 10px 0 13px}.top-types button{min-height:40px}.gear{width:40px;height:40px}.menu button{min-height:40px}.pills button{min-height:40px}#viewer-close{width:40px;height:40px}
  .pill-button{padding:10px 16px}.caret{width:36px;height:36px}#viewer:modal #rows tr.type td:first-child{padding-left:42px}.chip{padding:9px 12px}.chips .clear{padding:10px 4px}
  .comp-row{padding:11px 10px}td:first-child button{min-height:28px}#legend label{min-height:40px}#legend input{width:20px;height:20px}.zoom button{padding:9px 14px}}
/* Phones, a purple-to-teal line along the top edge; the sample as a pill and a bare
   sun or moon; the title over text tabs on a full-width hairline; chips that scroll off the right edge; the gene
   count, sort and search on one row; gene cards edge to edge, the map in a dark band over the name and stats on a
   bluer panel. The Cell types and Tumor heterogeneity pages share the bar, title, tabs and chips. */
:root{--tab-line:#6a4fd1;--tile-info:linear-gradient(180deg,#eef1fa 0%,#e9f0f9 100%)}
:root[data-theme=dark]{--tab-line:#8b8ff0;--tile-info:linear-gradient(180deg,#0f1739 0%,#0b1a40 100%)}
@media(max-width:560px){
  :root{--gutter:20px}
  header,main{padding-inline:var(--gutter)}
  header{background:var(--modal-rule),var(--page);background-color:var(--bg);background-size:100% 2px,100% 100vh,100% 100vh;background-repeat:no-repeat}
  .top-tools{gap:6px}
  .section-picker select{field-sizing:content;height:42px;padding:0 38px 0 16px;border-radius:999px;font-size:15px;background-position:right 11px center}
  .theme-toggle{width:40px;height:40px;margin-right:-6px;border:0;background:none}.theme-toggle .icon{width:19px;height:19px}
  main{padding-top:8px}
  .title-row{display:block;margin:0 calc(-1*var(--gutter));padding:0 var(--gutter);background:linear-gradient(var(--border),var(--border)) bottom/100% 1px no-repeat}
  h1{font-size:min(32px,8.2vw);font-weight:300;letter-spacing:-.035em;line-height:1.15}
  .tabs{gap:28px;max-width:none;margin:6px calc(-1*var(--gutter)) 0;padding-inline:var(--gutter)}
  .tabs button,.tabs button:first-child,.tabs button:last-child{flex:none;padding:12px 0 14px;font-size:15px}
  .tabs [aria-pressed=true]:after,.tabs button:first-child:after,.tabs button:last-child:after{left:-2px;right:-2px;bottom:0;height:1.5px;background:var(--tab-line)}
  /* Chips: outlined pills, the chosen one filled, in a row that scrolls past the right edge. */
  .chip-row{margin:18px 0 0}
  .chip-row .pills{max-width:none;margin-inline:calc(-1*var(--gutter));padding-inline:var(--gutter);gap:8px}.chip-row .pills::-webkit-scrollbar{display:none}
  .chip-row .pills button{flex:none;min-height:0;height:42px;padding:0 16px;border:1px solid var(--border-strong);font-size:14px;color:color-mix(in srgb,var(--text) 86%,transparent)}
  .chip-row .pills [aria-pressed=true]{border-color:transparent;font-weight:600}.chip-row .pills [aria-pressed=true]:not(.t1,.t2,.t3){background:var(--switch-on);color:var(--text)}
  .chip-row .pills+.pills{margin-top:10px}
  /* Sort and Rank by: bare text with a chevron; the gene search runs full width on its own row. */
  .tools{gap:6px;font-size:14px}.tools label{flex:0 1 auto;min-width:0;gap:6px}
  .tools select,#gallery-sort{field-sizing:content;width:auto;min-width:0;height:40px;padding:0 22px 0 2px;border:0;background-color:transparent;background-position:right 0 center;font-size:15px;font-weight:500}
  .gallery-filter .matches{right:0}.search input{font-size:16px}
  /* All genes: chips, picked genes, the search, then the count on the left of the sort, then the cards. */
  #gallery-view{display:grid;grid-template-columns:auto minmax(0,1fr);grid-auto-flow:row dense;align-items:center}
  #gallery-view>*,#gallery-view .chip-row>*{grid-column:1/-1;order:5}#gallery-view .chip-row{display:contents}
  /* Picked genes sit over the search, so its open list covers only the count row and cards. */
  #gallery-view .chip-row>.pills{order:1}#gallery-view #gallery-picked{order:2}#gallery-view .tools{display:contents}
  #gallery-view .gallery-filter{grid-column:1/-1;order:3;margin-top:16px}#gallery-view :is(.gallery-key,.tools label){order:4}
  #gallery-view .chip-row>.pills:first-child{margin-top:18px}
  #gallery-view .gallery-key{grid-column:1;margin:12px 0 10px;font-size:14px}#gallery-legend{display:none}
  #gallery-view .tools label{grid-column:2;justify-self:end;margin:12px -8px 10px 0}
  .gallery-count b{font-family:var(--mono);font-size:13.5px;font-weight:400;letter-spacing:-.02em}
  .chips{margin:14px 0 0}
  /* Gene cards edge to edge: the map in a dark band, a hairline, then the name and stats on a bluer panel. */
  .gallery{gap:0;margin-inline:calc(-1*var(--gutter));border-bottom:1px solid var(--border)}
  .tile{background:var(--tile-info);border-top:1px solid var(--border)}
  .tile :is(canvas,.prepared-map){box-sizing:content-box;border:0;border-bottom:1px solid var(--border);border-radius:0}
  .tile-head{margin-inline:var(--gutter);padding:24px 0 22px}
  .tile-head .gene-name{font-size:34px;font-weight:300}
  .tile-stats{gap:20px 16px;padding:28px var(--gutter) 32px;font-size:15px}.tile-stats .label{margin-right:0}
  /* Cell types: the map and its lists run edge to edge too, between hairlines, without rounded boxes. */
  #viewer:not(:modal) :is(.panels,.type-panels){gap:0}
  #viewer:not(:modal) .card{margin-inline:calc(-1*var(--gutter));border:0;border-radius:0;background:none}
  #viewer:not(:modal) .card+.card{border-top:1px solid var(--border)}#viewer:not(:modal) .map-key:has(#legend:empty){display:none}
  #viewer:not(:modal) .card-head,#viewer:not(:modal) .map-key{padding-inline:var(--gutter)}
  #viewer:not(:modal) :is(.composition,.markers){padding-inline:calc(var(--gutter) - 10px)}
  #viewer:not(:modal) .markers-why{padding-inline:var(--gutter)}
  #hetero-view .chip-row{margin-bottom:20px}#hetero-view .tools{margin-top:4px}}

.brand-block{--brand-gap:10px;display:grid;gap:1px}
.brand{gap:var(--brand-gap);color:var(--text);text-decoration:none}
.byline{justify-self:start;margin-left:calc(22px + var(--brand-gap));color:var(--muted);font-size:11px;text-decoration:none;white-space:nowrap}
.brand:hover strong,.byline:hover{text-decoration:underline;text-underline-offset:3px}
.data-credits{position:relative}
.data-credits summary{display:grid;place-items:center;list-style:none;width:36px;height:42px;cursor:pointer;color:var(--muted);border-radius:6px}
.data-credits summary::-webkit-details-marker{display:none}
.data-credits summary .icon{width:20px;height:20px}
.data-credits summary:hover,.data-credits[open] summary{color:var(--text);background:var(--hover)}
header :is(a,summary):focus-visible{outline:2px solid var(--teal);outline-offset:2px}
.sources-panel{position:absolute;top:100%;right:0;width:min(320px,calc(100vw - 84px));box-sizing:border-box;padding:14px 16px;border:1px solid var(--border-strong);border-radius:10px;background:var(--surface);color:var(--text);font-size:13px;line-height:1.55;box-shadow:0 6px 20px #0002}
.sources-panel p{margin-top:4px}.sources-panel a{color:var(--link)}
@media(max-width:380px){header{gap:4px;padding-inline:10px}.brand-block{--brand-gap:5px}.top-tools{gap:3px}.data-credits summary{width:30px}}


a.tile{text-decoration:none}.tile .prepared-map{display:block;background-image:var(--dark);background-size:100% 100%}
[data-theme="light"] .tile .prepared-map{background-image:var(--light)}
