/* The retrieval view: the search sidebar, the network canvas, the
   inspector, the banners. Tokens and the global reset live in
   00-tokens.css; this file styles only what retrieval draws. */

/* ==========================================================================
   Retrieval view: the 3-zone grid
   The header that used to sit here is the shell's now; see 01-shell.css.
   ========================================================================== */

/* The view is a flex child of .app-shell, under the header, so it claims the
   remaining height rather than declaring 100vh - which under the shell would
   have been a viewport of header + a full screen, and a scrollbar with it. */
.app-root {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* The row track has to be `minmax(0, 1fr)`, not the implicit `auto`. An auto
   row is sized by its tallest item's content, so a hit with a long GEO record
   made the inspector grow to fit rather than scroll: the page gained 410 px
   below the fold, the "Generate AI summary" button went off screen, and the
   network canvas - which is `height: 100%` of a column that had just got
   taller - was cut off at the bottom of the window. Bounding the track lets
   `.details-panel`'s own `overflow-y: auto` do the scrolling, which is what
   every `min-height: 0` and `overflow: hidden` in this file already assumed. */
.app-grid {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr) 384px;
  grid-template-rows: minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* ==========================================================================
   Left sidebar (tool panel)
   ========================================================================== */

.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-strong);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  overflow-y: auto;
}

.sidebar-title {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.control-group + .control-group {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}
.control-group-title {
  margin: 0 0 var(--space-1);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-primary);
  font-family: var(--font-heading);
}

.control-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  font-family: var(--font-heading);
}
.control-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.control-slider { padding: 2px 4px 0; }
/* Dash's slider thumb draws at 17px, which is under the 24px WCAG 2.2 SC 2.5.8
   asks of a pointer target. The hit area is widened rather than the thumb,
   because a 24px dot on a 4px track reads as a different control - the target
   is what the criterion is about, and it is the part nobody can see. */
.control-slider .dash-slider-thumb { position: relative; }
.control-slider .dash-slider-thumb::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
}

/* Text input.
   `input.dash-input` matched nothing and never has: Dash 4 puts `className` on
   a wrapping `div.dash-input-container` and gives the `<input>` inside it
   `dash-input-element`. The field looked right anyway, because the attribute
   selectors beside it do reach that inner input - so the class hook was simply
   dead weight. It is corrected to point at the element the other two already
   style rather than deleted, because it is the only hook a `dcc.Input` outside
   a `.control` would have.

   Two things about it are load-bearing, and both were learned the hard way.
   It is scoped to `.sidebar`, because Dash puts `dash-input` on *every*
   `dcc.Input` container - including the map's legend filter, which sits on the
   navy canvas and came out as a white box the moment this rule was unscoped.
   And it styles the inner input rather than the wrapper, because Dash styles
   that inner input too, so a focused field drew a ring inside a ring. */
.sidebar .dash-input .dash-input-element,
.control input[type="email"],
.control input[type="text"] {
  width: 100%;
  padding: 9px 11px;
  font-size: var(--text-base);
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sidebar .dash-input .dash-input-element:focus,
.control input[type="email"]:focus,
.control input[type="text"]:focus {
  border-color: var(--focus-ring);
  outline: 2px solid var(--focus-ring); outline-offset: 2px;
  box-shadow: none;
}

/* NASA red is reserved for primary query actions. */
.btn-primary {
  width: 100%;
  padding: 11px 14px;
  font-size: var(--text-base);
  font-weight: 600;
  font-family: var(--font-heading);
  color: #fff;
  background: var(--action-primary);
  border: 1px solid var(--action-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
  box-shadow: none;
}
.btn-primary:hover:not(:disabled) { background: var(--action-primary-hover); border-color: var(--action-primary-hover); }
.btn-primary:active:not(:disabled) { background: var(--action-primary-active); border-color: var(--action-primary-active); transform: translateY(1px); }
.btn-primary:disabled { background: var(--action-disabled-bg); color: var(--action-disabled-text); border-color: var(--border-strong); opacity: 1; cursor: not-allowed; box-shadow: none; }

/* Secondary / subtle button */
.btn-secondary {
  width: 100%;
  padding: 10px 14px;
  font-size: var(--text-base);
  font-weight: 600;


  border-width: 1px; border-style: solid;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.running-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  min-height: 18px;
}
.running-indicator:not(:empty)::before {
  content: "";
  width: 12px; height: 12px;
  border: 2px solid var(--accent-dim);
  border-top-color: var(--control-ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Checklist */
.dash-checklist .dash-options-list-option { font-size: var(--text-sm); color: var(--text-secondary); }

/* ==========================================================================
   Center workspace + right inspector
   ========================================================================== */

.workspace {
  padding: var(--space-4);
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.inspector {
  padding: var(--space-4) var(--space-4) var(--space-4) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
  overflow: hidden;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-4);
}

/* Full-height network canvas; neutral border preserves the original box. */
.panel--canvas {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-subtle);
  padding-top: calc(var(--space-4) - 1px);
}

/* `flex-start`, not `center`. The dot marks the panel, so it belongs against
   the panel's *title*; centering it against the whole block meant it drifted
   downward as the subtitle wrapped, and on a phone the canvas subtitle wraps
   to three lines, which put the dot beside the second one. */
.panel-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.panel-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-secondary);
  flex: none;
  /* Optical centre of the 18px title's first line, not the top of it. */
  margin-top: 7px;
}
/* Teal, because GRAPH_THEME's `cohort_a` is teal and this panel is about a
   pooled cohort. With one cohort on screen it is the only teal mark in the
   inspector; with two, the per-cohort role dots inside carry the distinction. */
.panel-dot--teal { background: var(--accent-teal); }
.panel-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.panel-subtitle {
  margin: 2px 0 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Selected-sample local preview (shown before a search is run) */
.sample-preview { margin-top: var(--space-1); }
.sample-preview-empty { margin: 0; font-size: var(--text-sm); color: var(--text-muted); }
.sample-preview-card {
  padding: var(--space-2) 0;
}
.sample-preview-name {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
  margin-bottom: var(--space-2);
}
.sample-preview-grid { display: flex; flex-direction: column; gap: 5px; }
.sample-preview-row { display: flex; gap: var(--space-2); align-items: baseline; font-size: var(--text-sm); }
.sample-preview-key {
  flex: none;
  width: 82px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.sample-preview-val { color: var(--text-secondary); word-break: break-word; }

/* Collapsible advanced section (metadata enrichment) */
.advanced-group { border-top: 1px solid var(--border-subtle); padding-top: var(--space-3); }
.advanced-summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.advanced-summary::-webkit-details-marker { display: none; }
.advanced-summary .control-group-title { margin: 0; }
.advanced-summary::after {
  content: "";
  flex: none;
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}
details[open] > .advanced-summary::after { transform: rotate(45deg); }
.advanced-body { margin-top: var(--space-3); display: flex; flex-direction: column; gap: var(--space-3); }

/* Graph legend strip */
.graph-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  margin-bottom: var(--space-3);
  background: transparent;
  border-block: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.legend-item { display: flex; align-items: center; gap: var(--space-2); }
.legend-swatch { width: 14px; height: 14px; flex: none; }
.legend-swatch--star {
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  background: var(--accent-teal);
}
.legend-swatch--query { border: 2px solid var(--network-query); border-radius: 50%; }
.legend-swatch--circle { border-radius: 50%; background: var(--network-sample); }
.legend-swatch--comparison-hit { background: var(--data-hit); }
.legend-swatch--diamond { transform: rotate(45deg); width: 11px; height: 11px; background: var(--network-study); }
.legend-divider { width: 1px; align-self: stretch; background: var(--border-strong); }
.legend-note { display: flex; align-items: center; gap: var(--space-2); color: var(--text-muted); }

.graph-wrap { flex: 1 1 auto; min-height: 320px; }
.graph-wrap .dash-graph, .graph-wrap .js-plotly-plot { height: 100%; }

/* ==========================================================================
   Details / inspector panel
   ========================================================================== */

/* The inspector fills the remaining height and scrolls long metadata. */
.details-panel {
  flex: 1 1 0;
  overflow-y: auto;
  min-height: 120px;
}

.details-empty {
  color: var(--text-secondary);
  font-size: var(--text-base);
}
.details-empty-hint {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.details-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.details-kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.details-heading {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}
.score-badge {
  flex: none;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.details-section { margin-top: var(--space-4); }
.details-section:first-of-type { margin-top: var(--space-2); }
.details-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  font-family: var(--font-heading);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  padding: 7px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.detail-row:last-child { border-bottom: none; }
.detail-row .label {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  white-space: nowrap;
  flex: none;
}
.detail-row .value {
  color: var(--text-primary);
  font-size: var(--text-base);
  text-align: right;
  word-break: break-word;
  min-width: 0;
}
.detail-row .value a { color: var(--link-color); text-decoration: none; }
.detail-row .value a:hover { text-decoration: underline; }
.detail-row .value.mono { font-family: var(--font-mono); font-size: var(--text-sm); }
.detail-row .value.empty { color: var(--text-muted); font-style: italic; }

/* long-form text blocks */
.detail-block { margin-top: var(--space-3); }
.detail-block-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}
.detail-block-body {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-collapse { margin-top: var(--space-3); }
.detail-collapse > summary {
  cursor: pointer;
  list-style: none;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--control-ink);
  padding: var(--space-2) 0;
  user-select: none;
}
.detail-collapse > summary::-webkit-details-marker { display: none; }
.detail-collapse > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
  color: var(--text-muted);
}
.detail-collapse[open] > summary::before { content: "▾ "; }

/* ==========================================================================
   AI summary panel
   ========================================================================== */

.ai-panel {
  flex: 0 0 auto;
  max-height: 46%;
  overflow-y: auto;
}
.ai-panel > summary { font-weight: 600; }
.ai-panel:not([open]) > :not(summary) { display: none; }
.ai-panel .details-empty-hint { margin: var(--space-3) 0; }
.ai-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  min-height: 16px;
  margin-top: var(--space-2);
}
.ai-status--loading::before {
  content: "";
  width: 12px; height: 12px;
  border: 2px solid var(--accent-dim);
  border-top-color: var(--control-ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: none;
}
.ai-output {
  margin-top: var(--space-3);
  overflow-y: auto;
  max-height: 320px;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--text-primary);
  padding-right: var(--space-2);
}
.ai-output:empty { display: none; }
.ai-output p:first-child { margin-top: 0; }
.ai-output h1, .ai-output h2, .ai-output h3 {
  font-size: var(--text-base);
  margin: var(--space-3) 0 var(--space-1);
  color: var(--text-primary);
}
.ai-output code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-inset);
  padding: 1px 4px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Status banner (search status + errors)
   ========================================================================== */

.status-banner {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  border: 1px solid var(--border-subtle);
  background: var(--status-info-soft);
  color: var(--text-secondary);
}
.status-banner-text { display: block; }
.status-good {
  background: transparent;
  border: 0; border-top: 1px solid var(--border-subtle);
  padding: var(--space-3) 0 0;
  color: var(--text-secondary);
}
.status-good .status-summary-lead {
  display: block; color: var(--text-primary); font-family: var(--font-heading);
  font-size: 13px; font-weight: 600; margin-bottom: var(--space-1);
}
.status-error {
  background: var(--status-error-soft);
  border-color: rgba(214, 69, 69, 0.35);
  color: var(--status-error);
}
.status-error .status-banner-text::before { content: "⚠ "; font-weight: 700; }

.status-details { margin-top: var(--space-2); }

/* Persistent notice that retrieval is running on a stand-in gene list.
   Deliberately heavier than .status-banner: it reports that the numbers on
   screen are not usable, so it must not read as routine run status. */
.invalid-banner {
  margin: 0 var(--space-4) var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(214, 69, 69, 0.4);
  border-left: 4px solid var(--status-error);
  border-radius: var(--radius-md);
  background: var(--status-error-soft);
  color: #8f2727;
}
.invalid-banner-title {
  display: block;
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.01em;
}
.invalid-banner-title::before { content: "⚠ "; }
.invalid-banner-body {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: #a33a3a;
  max-width: 105ch;
}
@media (max-width: 900px) {
  .invalid-banner { margin: 0 var(--space-3) var(--space-3); }
}

/* Unmet setup prerequisites, most often a clone whose Git LFS payload never
   arrived. Amber rather than red: the numbers on screen are not wrong, there
   are simply none yet, and this is a fixable local install problem. */
.setup-banner {
  margin: 0 var(--space-4) var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(183, 121, 31, 0.35);
  border-left: 4px solid var(--status-warn);
  border-radius: var(--radius-md);
  background: var(--status-warn-soft);
  color: #7a5210;
}
.setup-banner-title {
  display: block;
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.01em;
}
.setup-banner-title::before { content: "⚠ "; }
.setup-banner-body {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  line-height: 1.5;
  max-width: 105ch;
}
.setup-banner-list {
  margin: var(--space-2) 0 0;
  padding-left: 1.25rem;
  font-size: var(--text-sm);
  line-height: 1.6;
}
.setup-banner-list code,
.setup-banner-list {
  font-variant-numeric: tabular-nums;
}
@media (max-width: 900px) {
  .setup-banner { margin: 0 var(--space-3) var(--space-3); }
}
.status-details > summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: inherit;
  opacity: 0.8;
  user-select: none;
}
.status-details-pre {
  margin: var(--space-2) 0 0;
  max-height: 200px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-secondary);
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  white-space: pre-wrap;
  word-break: break-word;
}

/* thin, unobtrusive scrollbars inside panels */
.details-panel::-webkit-scrollbar,
.ai-output::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.status-details-pre::-webkit-scrollbar { width: 8px; height: 8px; }
.details-panel::-webkit-scrollbar-thumb,
.ai-output::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.status-details-pre::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Accessibility: visible keyboard focus + reduced-motion
   ========================================================================== */

/* Keyboard focus rings. :focus-visible keeps mouse clicks ring-free while
   still giving keyboard and screen-reader users a clear, on-brand indicator. */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
a:focus-visible,
summary:focus-visible,
.legend-item:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Responsive: three-column workbench → stacked, page-scrolling layout
   ========================================================================== */

/* Tablet and below: stack the columns and let the document scroll naturally
   instead of trapping the stacked panels inside a 100vh viewport lock (which
   clips content once three panels no longer fit one screen). */
@media (max-width: 1180px) {
  .app-root { flex: none; min-height: 0; overflow: visible; }
  .app-grid { grid-template-columns: 1fr; overflow: visible; }
  .sidebar,
  .workspace,
  .inspector { overflow: visible; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border-strong); }
  .inspector { padding: 0 var(--space-4) var(--space-4); }
  .ai-panel { max-height: none; }
  /* And the details panel goes back to a content basis here, for the same
     reason the two rules above lift their caps: once the document scrolls, a
     panel should be as tall as what it holds.

     `flex: 1 1 0` is right in the desktop column, where the column's height is
     fixed and this panel's job is to take what the other two leave. It is wrong
     the moment the column's height comes from its contents instead, because an
     item with a zero basis contributes nothing to that height - so the column
     sized itself to the other two panels and left this one on its 120px floor,
     scrolling internally with 372px hidden at 900px wide and 388px at 390px,
     where it used to stand at its full 491px and let the page scroll. Measured
     both ways on the running app before this rule was written. */
  .details-panel { flex: 1 1 auto; overflow: visible; }
}

/* Phone: relax padding, let the header wrap, keep touch targets comfortable. */
@media (max-width: 680px) {
  .sidebar,
  .workspace { padding: var(--space-3); }
  .inspector { padding: 0 var(--space-3) var(--space-3); }
  .graph-legend { flex-wrap: wrap; row-gap: var(--space-1); }
  .btn-primary,
  .btn-secondary { min-height: 44px; }
}

/* --- A link out to the map ----------------------------------------------- */
/* Offered under the search button once a retrieval has something the map can
   locate. Deliberately quieter than .btn-primary: it is the second thing to
   do, not a competing call to action. */

.btn-ghost {
  display: block;
  margin-top: var(--space-3);
  padding: 9px 14px;
  border-width: 1px; border-style: solid;
  border-radius: var(--radius-sm);


  font-size: var(--text-base);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease;
}


.btn-ghost:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* --- Uploaded-sample ingestion controls ------------------------------------ */
.upload-dropzone {
  margin-top: var(--space-1);
  padding: var(--space-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md, 8px);
  background: var(--bg-inset);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.upload-dropzone:hover {
  border-color: var(--focus-ring);
  background: var(--accent-soft);
}
.upload-dropzone-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
}
.upload-dropzone-hint {
  margin-top: 4px;
  font-size: var(--text-xs, 11.5px);
  color: var(--text-secondary);
  line-height: 1.35;
}
.upload-loaded {
  margin-top: var(--space-1);
  padding: var(--space-2);
  border: 1px solid var(--border-subtle);
  border-left: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-inset);
}
.upload-filename {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--text-sm);
  color: var(--text-primary);
  word-break: break-all;
}
.upload-meta {
  margin-top: 3px;
  font-size: var(--text-xs, 11.5px);
  color: var(--text-secondary);
}

/* ==========================================================================
   Cohort mode: the query-source switch, the facet chips, the confidence card

   One rule governs the whole block, and it is the rail's existing one: the
   fact that qualifies a control sits directly under that control. The cohort
   count hangs under the facet chips, the confidence card hangs under the
   cohort picker, and neither drifts into a summary panel somewhere else.
   ========================================================================== */

/* --- Sample / Cohort / Upload --------------------------------------------- */

/* Query-source navigation shares the header's thin red active indicator. */
.mode-switch {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 3px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.mode-tab {
  padding: 7px 4px;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.mode-tab:hover:not(.is-active) { color: var(--text-primary); background: var(--control-hover-fill); }
.mode-tab.is-active {
  color: var(--control-ink);
  background: var(--bg-panel);
  border-color: transparent;
  box-shadow: inset 0 -2px var(--action-primary);
}
.mode-tab:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }

/* `.mode-hint` used to sit here: a line under the switch naming what the
   selected source does. Removed on 2026-08-11 along with the three strings that
   filled it - the panel below the switch answers the same question with the
   actual controls, so the line was a caption on something already on screen. */

.control-group--query { gap: var(--space-3); }
.mode-panel { display: flex; flex-direction: column; gap: var(--space-3); }

/* --- Group by: the facet chips -------------------------------------------- */

.facet-chips { display: flex; flex-wrap: wrap; gap: 5px; }
/* `min-height`, because WCAG 2.2 SC 2.5.8 puts the floor for a pointer target
   at 24x24 CSS px and 4px of padding on 11.5px type measured 23. One pixel is
   not a judgement call when the criterion is a number. */
.facet-chip {
  padding: 4px 9px;
  min-height: 24px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.facet-chip:hover:not(:disabled) { border-color: var(--accent-dim); color: var(--text-primary); }
.facet-chip.is-on {
  color: var(--control-ink);
  background: var(--control-selected-fill);
  border-color: var(--control-border);
}
/* Study cannot be unticked: pooling across studies would average across the
   strongest batch boundary in the corpus. It is shown as part of the definition
   rather than as a dead control, so it keeps the "on" fill and loses only the
   pointer and the hover response. The reason is on the title attribute. */
.facet-chip.is-pinned {
  cursor: default;
  color: var(--control-ink);
  background: var(--control-selected-fill);
  border-color: var(--control-border);
  opacity: 1;
}
.facet-chip.is-pinned::after {
  content: "";
  display: inline-block;
  width: 4px; height: 4px;
  margin-left: 6px;
  vertical-align: 1px;
  border-radius: 50%;
  background: var(--control-ink);
}
.facet-chip:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

.facet-summary {
  margin-top: 7px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.facet-summary strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.facet-summary-warn { color: var(--status-warn); }

/* Cohort size qualifies the picker; it does not need a separate card. */
.cohort-card-slot { margin-top: -2px; }
.cohort-card {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.cohort-card--empty, .cohort-card-note { line-height: 1.45; }

.cohort-role {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 3px;
}
.cohort-role-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--accent-teal);
}
.cohort-card.is-b .cohort-role-dot { background: var(--accent-warm); }
.cohort-role-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
/* The facet the two arms differ in belongs to the pair, not to either cohort,
   so it is stated once - on the second card, beside the name that completes
   the pair. --text-secondary rather than --text-muted, which measures 2.90:1
   on white and fails AA at this size. */
.cohort-role-contrast {
  font-size: 11px;
  color: var(--text-secondary);
}
/* A cohort label runs long ("Liver · Space Flight"), and the rail is 288px, so
   it wraps rather than truncating: the name is how a reader ties this card to
   the star on the canvas and to the row in the map's key. */
.cohort-card-title {
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.cohort-card-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0;
}
.cohort-card-k {
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.cohort-card-k-label { font-size: 11.5px; color: var(--text-secondary); }

/* --- The member list ------------------------------------------------------- */

.cohort-members { margin-top: -2px; }
.cohort-members-summary {
  list-style: none;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  padding: 2px 0;
}
.cohort-members-summary::-webkit-details-marker { display: none; }
.cohort-members-summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  color: var(--text-muted);
  transition: transform 140ms ease;
}
.cohort-members[open] .cohort-members-summary::before { content: "▾"; }
.cohort-members-summary:hover { color: var(--text-primary); }
.cohort-members-body {
  margin-top: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
/* The list can run to 38 rows, which would push the search button off the rail. */
.member-list {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}
.member-list label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 3px 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-secondary);
  word-break: break-word;
}

/* --- The cohort inspector -------------------------------------------------- */

.cohort-member-list {
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}
.cohort-member {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 5px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.cohort-member:last-child { border-bottom: none; }
.cohort-member-name {
  font-family: var(--font-mono);
  font-size: 11.5px;
  word-break: break-all;
  color: var(--text-primary);
}
.cohort-member.is-outlier .cohort-member-name { color: var(--status-warn); }
.cohort-member-tag {
  flex: none;
  font-size: 10.5px;
  color: var(--status-warn);
  white-space: nowrap;
}
.cohort-member-list--excluded .cohort-member-name {
  color: var(--text-muted);
  text-decoration: line-through;
}


/* Comparison context stays in A/B order above the selected result. */
.comparison-cohort > summary { align-items: flex-start; }
.comparison-cohort > summary > div { min-width: 0; }
.comparison-cohort > summary::after { margin-top: var(--space-2); }
.comparison-cohort .details-head { margin-bottom: var(--space-1); }
.comparison-cohort .details-heading { overflow-wrap: anywhere; }
.comparison-cohort .details-kicker::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: var(--space-2);
  border-radius: 50%;
  background: var(--accent-teal);
}
.comparison-cohort.is-b .details-kicker::before { background: var(--accent-warm); }
.comparison-cohort + .comparison-cohort,
.comparison-selected-details {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}
.comparison-cohort-body > :last-child { margin-bottom: 0; }

/* Figure toolbar: opaque only while its group is visible. */
.graph-wrap .modebar-group { background: var(--bg-panel) !important; }
.graph-wrap .modebar-btn path { fill: var(--text-secondary) !important; }
.graph-wrap .modebar-btn:hover path,
.graph-wrap .modebar-btn.active path { fill: var(--text-primary) !important; }

/* Inspection emphasis leaves Plotly's data, hit testing and hover layer intact. */
.graph-wrap .network-edge-active .js-line {
  stroke: var(--network-emphasis) !important;
  stroke-width: 4.5px !important;
}
.graph-wrap .network-node-active {
  stroke: var(--network-emphasis) !important;
  stroke-width: 3px !important;
}
.graph-wrap .network-query.network-node-active {
  stroke: var(--network-query) !important;
  stroke-width: 4px !important;
}

/* ==========================================================================
   Results: the match table, its filters, and one plot of the same rows.
   docs/retrieval-results.md. The workspace splits its fixed height between
   the two panels; the table scrolls inside its own frame with a sticky head,
   which is what keeps the filters and the pager in view at k=1,000.
   ========================================================================== */

/* The table is the main event and gets the column's height; the plot sits
   below it at the height its figure asks for, and the column scrolls. Split
   evenly, both lost: at 1,000 px a 50-row page showed four rows, and a
   30-match network asks for about 860 px. The 96 px left over keeps the plot's switch in view as the cue to scroll. */
.results-workspace {
  gap: var(--space-4);
  overflow-y: auto;
  scrollbar-gutter: stable;
}
/* Sized to its rows, capped at the column: a five-match result used to sit
   in a 700 px panel that was mostly empty, with the plot pushed below the
   fold. Now few rows let the plot rise into view, and a full page still
   scrolls inside the table frame with the head and pager in place. */
.results-panel {
  flex: none;
  max-height: max(520px, calc(100% - 96px));
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.results-workspace .plot-panel {
  flex: none;
  min-height: 0;
}

.results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.results-heading { min-width: 0; }
.results-actions { display: flex; gap: var(--space-2); flex: none; }
.results-actions .btn-compact,
.results-pager .btn-compact {
  display: inline-flex;
  align-items: center;
  width: auto;
  margin: 0;
  padding: 6px 12px;
  min-height: 32px;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
}
.results-pager .btn-compact:disabled {
  color: var(--action-disabled-text);
  background: transparent;
  border-color: var(--border-subtle);
  cursor: not-allowed;
}

/* --- Filters ---------------------------------------------------------------- */

.results-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3) var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}
.results-filter { display: flex; flex-direction: column; min-width: 120px; flex: 1 1 140px; }
.results-filter--wide { flex: 2 1 230px; max-width: 340px; }
.results-filter--grow { flex: 2 1 180px; }
.results-filter .control-label { margin-bottom: var(--space-1); white-space: nowrap; }
.results-filter .results-input--score { max-width: 112px; }
.results-filter:has(.results-input--score) { flex: 0 1 112px; min-width: 96px; }
.results-filter .dash-dropdown { min-height: var(--control-height); font-size: 13px; }

.results-filter .dash-input-element {
  width: 100%;
  height: var(--control-height);
  padding: 0 10px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-panel);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--interaction-duration) ease;
}
.results-filter .dash-input-element::placeholder { color: var(--text-secondary); }
.results-filter .dash-input-element:hover { border-color: var(--control-hover); }
.results-filter .dash-input-element:focus-visible {
  outline: 2px solid var(--focus-ring); outline-offset: 2px;
}
.results-input--score .dash-input-element { font-family: var(--font-mono); }

.results-actions { align-items: center; }

/* A segmented RadioItems on the light chrome: the map's .bm-seg pattern,
   restated here rather than shared so neither view's rules reach the other.
   The radio is clipped, never `display: none`, so it keeps its tab stop. */
.results-seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
}
.results-seg .dash-options-list-option {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background var(--interaction-duration) ease, color var(--interaction-duration) ease;
}
.results-seg .dash-options-list-option-wrapper {
  position: absolute;
  width: 1px; height: 1px;
  margin: 0; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
.results-seg .dash-options-list-option-text { color: inherit; }
.results-seg .dash-options-list-option:hover { color: var(--text-primary); }
.results-seg .dash-options-list-option.selected {
  color: var(--control-ink);
  background: var(--bg-panel);
  box-shadow: inset 0 -2px var(--control-ink);
  font-weight: 600;
}
.results-seg .dash-options-list-option:focus-within {
  outline: 2px solid var(--focus-ring); outline-offset: 1px;
}
/* A wide filter's options can carry cohort names ("Only Liver · Basal
   Control"), so they wrap rather than push the page sideways: unwrapped, a
   comparison scrolled to 1,008 px at 900 and 522 px at 390. Found by
   e2e_cohort_check.py in the browser-suites session. */
.results-filter--wide .results-seg { flex-wrap: wrap; }
.results-filter--wide .results-seg .dash-options-list-option {
  white-space: normal;
  text-align: center;
}

/* --- The table -------------------------------------------------------------- */

/* `position: relative` contains the visually hidden "Not in top k" labels in
   a comparison's blank cells: they are absolutely positioned, and with no
   positioned ancestor they escaped this scroller and widened a 320 px page to
   328 px (found by e2e_cohort_check.py). */
.results-table-wrap {
  position: relative;
  flex: 0 1 auto;
  min-height: 160px;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  outline: none;
}
.results-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  color: var(--text-primary);
}
.results-table th,
.results-table td {
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-subtle);
}
.results-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0;
  background: var(--bg-panel-raised);
  border-bottom: 1px solid var(--border-strong);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
}
.results-table tbody tr:last-child td { border-bottom: 0; }

/* Fixed widths for everything measurable, so Title - the only column whose
   length varies by an order of magnitude, and the most informative - takes
   what is left: about 270 px at 1,600 px wide, against 100 px before. */
.results-table .col-rank_a { width: 58px; }
.results-table .col-score_a { width: 74px; }
/* A comparison's "Rank A" / "Score A" plus the sort mark need more; at the
   single-query widths they wrapped and doubled the header's height. */
.results-table--comparison .col-rank_a,
.results-table--comparison .col-rank_b { width: 70px; }
.results-table--comparison .col-score_a,
.results-table--comparison .col-score_b { width: 82px; }
/* The "Same profile" note truncates here with the full list on hover, so an
   identical profile marks its row without widening the column. */
.results-table .col-gsm { width: 124px; }
.results-table .col-gse { width: 100px; }
.results-table .col-tissue { width: 128px; }
.results-table .col-species { width: 100px; }

.results-table .col-num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.results-table .col-gse { font-family: var(--font-mono); font-size: 12.5px; }
/* One line: "Mus musculus" wrapping made every row of a page double height. */
.results-table .col-species {
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.results-table thead th { white-space: nowrap; }
/* Headers are labels, not values: the cell fonts above (mono numerals and
   accessions, italic species) matched the header cells too, so "Score" and
   "Series" set in mono and "Species" in italic beside sans "Tissue category". */
.results-table thead th.col-num,
.results-table thead th.col-gse,
.results-table thead th.col-species {
  font-family: var(--font-heading);
  font-style: normal;
  font-size: var(--text-sm);
}
.results-table .col-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.results-table .col-tissue { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results-table .is-missing { color: var(--text-secondary); }

.sort-button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  color: var(--text-primary);
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.col-num .sort-button { justify-content: flex-end; }
.sort-button:hover { background: var(--control-hover-fill); }
.sort-button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.sort-button::after {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0;
  transition: transform var(--interaction-duration) ease, opacity var(--interaction-duration) ease;
}
.sort-button:hover::after { opacity: 0.35; transform: rotate(45deg) translateY(-2px); }
.sort-button.is-ascending::after { opacity: 1; transform: rotate(-135deg) translateY(-2px); }
.sort-button.is-descending::after { opacity: 1; transform: rotate(45deg) translateY(-2px); }

.result-row { cursor: pointer; transition: background var(--interaction-duration) ease; }
.result-row:hover { background: var(--control-hover-fill); }
.result-row.is-selected { background: var(--control-selected-fill); }
.result-row.is-selected .result-select { font-weight: 600; }

.result-select {
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--link-color);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color var(--interaction-duration) ease;
}
.result-select:hover { text-decoration-color: currentColor; }
.result-select:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.result-twin {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-secondary);
}

.results-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 160px;
  height: 100%;
  padding: var(--space-4);
  text-align: center;
}
.results-empty-text { margin: 0; font-size: var(--text-base); color: var(--text-secondary); }

.results-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}
.results-pager:has(.results-page-label:empty) { display: none; }
.results-page-label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

/* --- The plot ----------------------------------------------------------------- */

.plot-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-3);
}
.results-seg--plot { flex: none; }

/* Matching: two equal halves under Number of matches. An unavailable option
   (no cache/whitening.npz on this machine) stays visible and says so. */
.matching-control { margin-top: var(--space-3); }
.results-seg--matching .dash-options-list-option { flex: 1 1 0; }
.results-seg .dash-options-list-option:has(input:disabled) {
  cursor: not-allowed;
  color: var(--action-disabled-text);
  background: none;
}
.results-seg--plot .dash-options-list-option { flex: none; padding: 6px 14px; }
.plot-caption { margin: 0; flex: 1 1 260px; }
.plot-panel .graph-wrap { flex: none; min-height: 320px; }
.plot-panel .graph-wrap .dash-graph,
.plot-panel .graph-wrap .js-plotly-plot { height: auto; }

/* --- Number of matches ------------------------------------------------------- */

.topk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}
.topk-head .control-label { margin: 0; white-space: nowrap; }
.topk-head .topk-input { flex: none; width: 128px; }
.sidebar .topk-input .dash-input-element {
  width: 100%;
  padding: 5px 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Between the stacked layout and a wide screen the table is the column that
   runs short: at 1,400 px the centre was 644 px, the fixed columns took 570
   of it and Title kept 74. The inspector's label/value rows read the same at
   328 px, so it gives up 56 px here rather than the table scrolling sideways. */
@media (min-width: 1181px) and (max-width: 1480px) {
  .app-grid { grid-template-columns: 288px minmax(0, 1fr) 328px; }
}

/* The table fits its own frame by dropping the least essential columns as the
   frame narrows, rather than scrolling sideways. Ranks, scores and GSM always
   stay; whatever is hidden is still in the inspector and the CSV. A comparison
   needs more room (two ranks and two scores), and before this it ran 16 px past
   its frame at 1,440 px and 275 px at 1,181 px, with Title squeezed to nothing
   and Species clipped (found 2026-10-22).

   Order: Species, then Series, then Title, then Tissue category. Each
   threshold is the sum of the visible fixed widths above plus 140 px for
   Title, the narrowest it is still worth showing.
     single:      58+74+124+100+128+100 = 584
     comparison:  70+82+70+82+124+100+128+100 = 756 */
.results-table-wrap { container: results-table / inline-size; }
@container results-table (max-width: 723px) {
  .results-table:not(.results-table--comparison) .col-species { display: none; }
}
@container results-table (max-width: 623px) {
  .results-table:not(.results-table--comparison) .col-gse { display: none; }
}
@container results-table (max-width: 523px) {
  .results-table:not(.results-table--comparison) .col-title { display: none; }
}
@container results-table (max-width: 383px) {
  .results-table:not(.results-table--comparison) .col-tissue { display: none; }
}
@container results-table (max-width: 895px) {
  .results-table--comparison .col-species { display: none; }
}
@container results-table (max-width: 795px) {
  .results-table--comparison .col-gse { display: none; }
}
@container results-table (max-width: 695px) {
  .results-table--comparison .col-title { display: none; }
}
@container results-table (max-width: 555px) {
  .results-table--comparison .col-tissue { display: none; }
}

@media (max-width: 1180px) {
  .results-workspace { overflow: visible; }
  .results-panel { max-height: none; }
  .results-table-wrap { flex: none; max-height: 70vh; }
}

@media (max-width: 680px) {
  .results-head { flex-direction: column; }
  .results-filter,
  .results-filter--wide,
  .results-filter--grow { flex: 1 1 100%; max-width: none; }
  /* Four options do not fit beside each other at 320 px; "Network" was
     pushed 50 px past the edge. They wrap to a second row instead. */
  .results-seg--plot { width: 100%; flex-wrap: wrap; }
  .results-seg--plot .dash-options-list-option { flex: 1 1 auto; padding: 6px 8px; }
  .results-actions { flex-wrap: wrap; }
}
