/* B · Merge: the atlas as a fluorescence composite. Black field, two channel inks, white where they co-occur. */
:root {
  /* light (default): the composite printed on white; channels mix like inks, overlap darkens */
  --field: #f5f6f8;
  --sheet: #ffffff;
  --sheet-2: #eef1f5;
  --line: #dce1e8;
  --ink: #10151c;
  --on-ink: #ffffff;
  --muted: #566274;
  --dapi: #2d5bd0;
  --ch1: #12a058;
  --ch2: #c8189a;
  --up: #c4372a;
  --down: #1d62c2;
  --rule: #b5bfcc;
  --ns: #a3adbb;
  --row-line: #edf0f4;
  --row-sel: #e6edfb;
  --body-2: #2b3442;
  --tip-bg: rgba(255, 255, 255, 0.97);
  --shadow: rgba(16, 24, 40, 0.14);
  --focus: rgba(45, 91, 208, 0.2);
  --placeholder: #5d697c;
  --scroll: #c3cad4;
  --plabel-shadow: 0 1px 3px rgba(255, 255, 255, 0.9);
  --glow: 0;
  --font-ui: "Barlow", system-ui, sans-serif;
  --font-cond: "Barlow Semi Condensed", "Barlow", sans-serif;
  --map-bg: #ffffff;
  --map-none: #e2e6ec;
  --ramp: #bfead1,#63cf93,#12a058,#0a6638,#04311b;
  --merge: 1;
  --merge-op: multiply;
  --map-alpha: 0.82;
  --panel-gap: 2;
  --gutter-shade: 1;
  --gutter: #dce1e8;
  --ink-on-map: #10151c;
  --muted-on-map: #566274;
  color-scheme: light;
}
:root[data-theme="dark"] {
  /* dark: the fluorescence field; channels add as light, overlap glows white */
  --field: #05070a;
  --sheet: #0c1016;
  --sheet-2: #121821;
  --line: #222b37;
  --ink: #e8edf2;
  --on-ink: #05070a;
  --muted: #93a0b0;
  --dapi: #6c9cff;
  --ch1: #3ef07a;
  --ch2: #ff3df2;
  --up: #ff7a6b;
  --down: #63b3ff;
  --rule: #3a4554;
  --ns: #4c5868;
  --row-line: #18202a;
  --row-sel: #162033;
  --body-2: #cfd7e0;
  --tip-bg: rgba(12, 16, 22, 0.96);
  --shadow: rgba(0, 0, 0, 0.5);
  --focus: rgba(108, 156, 255, 0.22);
  --placeholder: #7d8aa0;
  --scroll: #2b3644;
  --plabel-shadow: 0 1px 6px #000;
  --glow: 1;
  --map-bg: #05070a;
  --map-none: #273040;
  --ramp: #12422a,#1f8a4c,#3ef07a,#b8ffd2,#ffffff;
  --merge-op: add;
  --gutter: #222b37;
  --ink-on-map: #e8edf2;
  --muted-on-map: #93a0b0;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font: 400 14px/1.5 var(--font-ui); color: var(--ink); background: var(--field); font-variant-numeric: tabular-nums; }
::selection { background: var(--ch2); color: var(--on-ink); }
a { color: var(--dapi); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--dapi); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h2, h3 { margin: 0; letter-spacing: -0.01em; }
.note { color: var(--muted); font-size: 12.5px; margin: 6px 0; }
.num { text-align: right; }
.up { color: var(--up); font-weight: 600; } .down { color: var(--down); font-weight: 600; }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; flex: none; }
* { scrollbar-color: var(--scroll) transparent; scrollbar-width: thin; }

/* bar */
.bar { height: 52px; display: flex; align-items: center; gap: 22px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--field); }
.brand { display: flex; align-items: center; gap: 10px; font: 700 17px var(--font-ui); color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-mark { position: relative; width: 22px; height: 22px; }
.brand-mark i { position: absolute; width: 13px; height: 13px; border-radius: 50%; mix-blend-mode: multiply; }
:root[data-theme="dark"] .brand-mark i { mix-blend-mode: screen; }
.brand-mark i:nth-child(1) { background: var(--ch1); left: 0; top: 0; }
.brand-mark i:nth-child(2) { background: var(--ch2); right: 0; top: 0; }
.brand-mark i:nth-child(3) { background: var(--dapi); left: 4px; bottom: 0; }
.nav { display: flex; gap: 4px; overflow-x: auto; }
.nav a { color: var(--muted); text-decoration: none; font: 600 14px var(--font-cond); padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--sheet-2); }
.nav a.on { color: var(--ink); background: var(--sheet-2); box-shadow: inset 0 -2px 0 var(--dapi); }
.theme-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--sheet-2); color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; transition: border-color 0.15s; }
.theme-btn:hover { border-color: var(--dapi); }
.theme-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
.bar-meta { margin-left: auto; color: var(--muted); font: 500 13px var(--font-cond); white-space: nowrap; }

/* controls */
.btn { font: 600 13px var(--font-cond); letter-spacing: 0.01em; color: var(--ink); background: var(--sheet-2); border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: background 0.15s, border-color 0.15s; }
.btn:hover { border-color: var(--dapi); }
.btn.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn.primary:hover { background: var(--dapi); border-color: var(--dapi); color: #fff; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.link, .link { background: none; border: 0; padding: 2px 0; color: var(--dapi); cursor: pointer; font: 500 12.5px var(--font-ui); text-decoration: underline; text-underline-offset: 3px; }
.link:disabled { color: var(--muted); opacity: 0.6; text-decoration: none; cursor: default; }
input, select { font: 500 14px var(--font-ui); color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; width: 100%; min-width: 0; }
input:focus, select:focus { border-color: var(--dapi); outline: none; box-shadow: 0 0 0 3px var(--focus); }
input::placeholder { color: var(--placeholder); }
select option { background: var(--sheet); }

/* stage: full-bleed field with a docked channel sheet */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 330px; height: calc(100vh - 52px); min-height: 520px; }
.canvas-wrap { position: relative; background: var(--map-bg); min-width: 0; }
#umap { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#umap:active { cursor: grabbing; }
#panelLabels { position: absolute; inset: 0; pointer-events: none; }
.plabel { position: absolute; }
.plabel-name { position: absolute; left: 14px; top: 12px; font: 600 15px var(--font-cond); color: var(--ink); text-shadow: var(--plabel-shadow); }
.plabel-name i { font-style: italic; }
.plabel-count { position: absolute; left: 14px; top: 34px; font: 500 12px var(--font-cond); color: var(--muted); }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font: 600 14px var(--font-cond); }
.loading.error { color: var(--up); }
.tip { position: absolute; z-index: 3; pointer-events: none; background: var(--tip-bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 12.5px; max-width: 300px; box-shadow: 0 8px 24px var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.tip b { font-size: 13.5px; }
.tip-s, .tip-m { color: var(--muted); }
.tip-g { font-weight: 600; }
.map-tools { position: absolute; right: 14px; bottom: 44px; display: flex; flex-direction: column; background: var(--sheet); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.map-tools button { width: 36px; height: 36px; border: 0; background: none; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.map-tools button + button { border-top: 1px solid var(--line); }
.map-tools button:hover { background: var(--sheet-2); }
.map-tools svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.map-note { position: absolute; left: 14px; bottom: 10px; right: 64px; margin: 0; color: var(--muted); font: 500 12.5px var(--font-cond); pointer-events: none; }

.channels { background: var(--sheet); border-left: 1px solid var(--line); display: flex; flex-direction: column; overflow-y: auto; }
.ch-block { padding: 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.ch-block.grow { flex: 1; }
.ch-block h2 { font: 700 12px var(--font-cond); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.ch { display: grid; grid-template-columns: 14px 1fr; grid-template-rows: auto auto; column-gap: 10px; row-gap: 4px; align-items: center; }
.ch label { font: 600 12.5px var(--font-cond); color: var(--muted); }
.ch input { grid-column: 2; }
.ch-dot { width: 12px; height: 12px; border-radius: 50%; grid-row: 1 / span 2; align-self: center; }
.ch-dot.ch1 { background: var(--ch1); }
.ch-dot.ch2 { background: var(--ch2); }
.row { display: flex; gap: 8px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 3px; }
.seg button { font: 600 13px var(--font-cond); background: none; color: var(--muted); border: 0; border-radius: 5px; padding: 6px 4px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--sheet-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule); }
.seg button:disabled { opacity: 0.35; cursor: default; }
.legend-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; margin-top: 4px; }
.legend { list-style: none; margin: 0; padding: 0; }
.legend button { display: flex; align-items: center; width: 100%; background: none; border: 0; border-radius: 5px; padding: 4px 6px; font: 13px var(--font-ui); color: var(--ink); text-align: left; cursor: pointer; }
.legend button:hover { background: var(--sheet-2); }
.legend .lb { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend .ct { color: var(--muted); font-size: 12px; margin-left: 8px; }
.legend button.off { opacity: 0.42; }
.ch-actions { display: flex; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--sheet); flex-wrap: wrap; }
.gene-key { padding: 8px 0; border-bottom: 1px solid var(--line); }
.gk-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.gk-head a { font-size: 12px; }
.gk-ramp { height: 8px; border-radius: 4px; margin: 8px 0 3px; }
.gk-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.gk-pct { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; margin-top: 6px; color: var(--muted); }
.gk-pct b { color: var(--ink); }
.merge-key { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13px; padding: 8px 10px; background: var(--map-bg); border-radius: 8px; border: 1px solid var(--line); }
.mk { width: 12px; height: 12px; border-radius: 50%; }
.mk-both { margin-left: 6px; }

/* tour floats over the field, bottom left, as a caption card */
.tour { position: absolute; left: 14px; bottom: 40px; width: min(380px, calc(100% - 90px)); background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: 0 16px 40px var(--shadow); z-index: 4; display: flex; flex-direction: column; gap: 12px; animation: rise 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.tour-count { font: 600 12px var(--font-cond); color: var(--dapi); }
.tour h3 { font: 700 19px/1.2 var(--font-ui); margin: 4px 0 6px; }
.tour p { margin: 0; color: var(--body-2); line-height: 1.55; }
.tour-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tour-dots { display: flex; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; border: 0; background: var(--rule); padding: 0; cursor: pointer; }
.dot.on { background: var(--ch1); }

/* pages */
.page { max-width: 1160px; margin: 0 auto; padding: 30px 24px 64px; }
.page.narrow { max-width: 760px; }
.page h2 { font: 700 26px var(--font-ui); }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.lede { color: var(--muted); max-width: 75ch; margin: 0 0 20px; }
.box { background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; overflow-x: auto; }
.box h3 { font: 700 12px var(--font-cond); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lookup { display: flex; gap: 8px; max-width: 560px; margin-bottom: 22px; }
.search { display: flex; gap: 8px; }
.gene-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.gene-head h2 { font-size: 34px; font-weight: 600; }
.gene-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.badge { display: inline-flex; align-items: center; background: var(--sheet-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 600; }
.gene-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.gene-lower { display: grid; grid-template-columns: minmax(0, 760px) minmax(240px, 1fr); gap: 20px; align-items: start; }
.gene-lower .compare-with { margin-top: 0; }
.forest { background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; padding: 16px; overflow-x: auto; }
.compare-with { margin-top: 16px; background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.compare-with label { display: block; font: 600 13px var(--font-cond); color: var(--muted); margin-bottom: 6px; }
.gene-empty { background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.gene-empty p { margin: 0 0 8px; } .gene-empty a { margin-right: 10px; }
.table-wrap { overflow-x: auto; background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; }
.grid-table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.grid-table caption { text-align: left; padding: 10px 12px 0; }
.grid-table th { font: 600 12px var(--font-cond); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); text-align: left; border-bottom: 1px solid var(--line); padding: 10px 12px; white-space: nowrap; }
.grid-table th.num { text-align: right; }
.grid-table th button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-transform: inherit; letter-spacing: inherit; }
.grid-table th[aria-sort="ascending"] button::after { content: " ↑"; } .grid-table th[aria-sort="descending"] button::after { content: " ↓"; }
.grid-table td { border-bottom: 1px solid var(--row-line); padding: 8px 12px; white-space: nowrap; }
.grid-table tbody tr[data-c] { cursor: pointer; }
.grid-table tbody tr:hover { background: var(--sheet-2); }
.grid-table tr.sel { background: var(--row-sel); box-shadow: inset 2px 0 0 var(--dapi); }
.ci { color: var(--muted); font-weight: 400; }
.empty-row { text-align: center; color: var(--muted); padding: 26px !important; white-space: normal !important; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters select { width: auto; } .filters input { flex: 1; min-width: 160px; width: auto; }
.count { color: var(--muted); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 14px; color: var(--muted); }
.facts { border-collapse: collapse; margin: 16px 0; min-width: 360px; }
.facts th { text-align: left; font-weight: 500; color: var(--muted); padding: 8px 16px 8px 0; border-bottom: 1px solid var(--line); }
.facts td { padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.status { color: var(--muted); } .status.error { color: var(--up); } .status.empty { color: var(--ink); }
.f-title { font: 600 13px var(--font-ui); fill: var(--ink); }
.f-lab { font: 12px var(--font-ui); fill: var(--ink); } .f-strong { font-weight: 700; }
.f-tick { font: 11px var(--font-ui); fill: var(--muted); }
.f-zero { stroke: var(--rule); stroke-dasharray: 3 3; }
.f-ci { stroke: var(--ink); stroke-width: 1.6; } .f-dia { fill: var(--ink); }
line.f-up { stroke: var(--up); } line.f-down { stroke: var(--down); } line.f-ns { stroke: var(--ns); }
circle.f-up.fill { fill: var(--up); stroke: var(--up); } circle.f-down.fill { fill: var(--down); stroke: var(--down); }
circle.hollow { fill: var(--sheet); } circle.f-ns { stroke: var(--ns); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 12px); background: var(--ink); color: var(--on-ink); border-radius: 8px; padding: 10px 16px; font-weight: 600; font-size: 13px; opacity: 0; transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); z-index: 20; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) { .bar-meta { display: none; } }
@media (max-width: 900px) {
  .bar { gap: 10px; padding: 0 10px; } .brand { font-size: 15px; }
  #tourBtn { padding: 6px 8px; font-size: 12px; }
  .stage { grid-template-columns: 1fr; grid-template-rows: 68vh auto; height: auto; }
  .channels { border-left: 0; border-top: 1px solid var(--line); }
  .ch-actions { position: static; }
  .two, .gene-grid, .gene-lower { grid-template-columns: minmax(0, 1fr); }
  .tour { left: 10px; right: 10px; width: auto; bottom: 40px; }
}
@media (prefers-reduced-motion: reduce) { .tour { animation: none; } .toast { transition: none; } }

/* plots never widen their container; the engine redraws them at the container width */
.forest svg, .box svg, .fig svg, #abMajor svg, #abSub svg, #states svg { max-width: 100%; height: auto; display: block; }
.gene-table, .gene-lower > * { min-width: 0; }

/* phones: tables become labelled stacks so every value is visible without sideways scrolling */
@media (max-width: 600px) {
  .grid-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .grid-table, .grid-table tbody, .grid-table tr, .grid-table td { display: block; width: 100%; }
  .grid-table caption { display: block; }
  .grid-table tr { padding: 10px 12px; border-bottom: 1px solid var(--line, #ddd); }
  .grid-table td { border: 0 !important; padding: 2px 0 !important; white-space: normal !important; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .grid-table td.lead { font-weight: 700; font-size: 15px; justify-content: flex-start; text-align: left; padding-bottom: 6px !important; }
  .grid-table td[data-label] { justify-content: flex-end; gap: 6px; }
  .grid-table td[data-label]::before { content: attr(data-label); color: var(--muted, #666); font-weight: 500; text-align: left; margin-right: auto; }
  .grid-table td.empty-row { display: block; text-align: center; }
  .grid-table tr.sel { box-shadow: inset 3px 0 0 var(--dapi, var(--spot, #333)); }
  .table-wrap { overflow-x: visible; }
}

/* ---- extra views: expression by cell type, gene list, genome-wide, data page ---- */
.gene-dots { margin-top: 20px; }
.dots-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.dots-head h3 { margin: 0; }
.seg.seg3 { grid-template-columns: repeat(3, 1fr); }
.cmp-box { display: grid; grid-template-columns: 1fr; gap: 6px; }
.cmp-box label span, .genome-controls label > span, .list-actions .inline span { display: block; font: 600 12px var(--font-cond); color: var(--muted); margin-bottom: 3px; }
.list-form { display: grid; gap: 10px; margin-bottom: 18px; }
.list-form textarea { font: 500 14px var(--font-ui); color: var(--ink); background: var(--sheet); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; resize: vertical; width: 100%; }
.list-form textarea:focus { border-color: var(--dapi); outline: none; box-shadow: 0 0 0 3px var(--focus); }
.list-actions { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.list-actions .inline select { width: auto; }
.heat-wrap { padding: 0; }
.heat { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: 13px; }
.heat thead th { font: 600 12px var(--font-cond); color: var(--muted); text-align: center; padding: 8px 6px; vertical-align: bottom; white-space: normal; min-width: 76px; }
.heat thead th:first-child { text-align: left; }
.heat tbody th { text-align: left; padding: 6px 10px; white-space: nowrap; font-weight: 500; }
.heat td { text-align: center; padding: 7px 6px; border-radius: 4px; color: var(--ink); font-variant-numeric: tabular-nums; position: relative; }
.heat td.dark { color: #fff; }
.heat td.sig { font-weight: 700; }
.heat td.rob::after { content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.heat td.na { color: var(--muted); background: var(--sheet-2); }
.heat-key { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; font-size: 12.5px; color: var(--muted); align-items: center; }
.rob-key { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); margin-right: 6px; vertical-align: 1px; }
.ramp-key { display: inline-flex; align-items: center; gap: 6px; }
.ramp-key .rk { width: 110px; height: 9px; border-radius: 3px; border: 1px solid var(--line); }
.page.wide { max-width: 1280px; }
.genome-controls { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; margin-bottom: 8px; }
.genome-controls select { width: auto; min-width: 200px; }
.genome-controls .grow { flex: 1; min-width: 220px; max-width: 420px; }
.gplots { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.plotbox { margin: 0; }
.plot-host { min-width: 0; }
.plot-host canvas { display: block; }
.gplots .tip { position: absolute; }
.gplots .tip span { color: var(--muted); }
.prog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.prog-head h3 { margin: 0; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.check input { width: auto; }
.sub-h { margin-top: 40px; }
.mini { font: 700 12px var(--font-cond); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 22px 0 8px; }
.dl-list { padding-left: 18px; line-height: 1.7; }
.grid-table td.wrap { white-space: normal; min-width: 180px; }
@media (max-width: 900px) { .gplots { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .heat-wrap { overflow-x: auto !important; }
  .heat { border-spacing: 1px; font-size: 11px; }
  .heat thead th { min-width: 0; padding: 4px 2px; font-size: 10.5px; writing-mode: vertical-rl; transform: rotate(180deg); text-align: left; height: 112px; }
  .heat thead th:first-child { writing-mode: horizontal-tb; transform: none; height: auto; vertical-align: bottom; }
  .heat thead th .sw { margin: 0 0 6px; }
  .heat tbody th { padding: 4px 6px; font-size: 12px; }
  .heat td { padding: 6px 1px; }
  .heat td.rob::after { top: 2px; right: 2px; width: 4px; height: 4px; }
}

.src-links a { display: block; white-space: nowrap; }
#studyTable .grid-table td.wrap { min-width: 140px; }
.src-links a { font-weight: 600; }

