* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, sans-serif; background: #111; color: #eee;
  height: 100vh; display: flex; flex-direction: column; overflow: hidden;
}

/* ── header ── */
header {
  background: #1a1a2e; padding: 8px 16px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid #333; flex-shrink: 0;
}
header h1 { font-size: 1rem; font-weight: 600; color: #7eb8f7; white-space: nowrap; }
select {
  background: #222; color: #eee; border: 1px solid #444;
  border-radius: 6px; padding: 4px 8px; font-size: 0.82rem; cursor: pointer;
}
select:focus { outline: none; border-color: #7eb8f7; }
label { font-size: 0.8rem; color: #aaa; white-space: nowrap; }
input[type=range] { accent-color: #7eb8f7; cursor: pointer; }

.btn {
  flex-shrink: 0; background: #222; color: #888; border: 1px solid #444;
  border-radius: 4px; padding: 4px 12px; cursor: pointer;
  font-size: 0.82rem; white-space: nowrap; transition: color 0.15s, border-color 0.15s;
}
.btn:hover:not(:disabled) { border-color: #7eb8f7; color: #7eb8f7; }
.btn.active  { border-color: #7eb8f7; color: #7eb8f7; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-primary { border-color: #7eb8f7; color: #7eb8f7; font-weight: 600; padding: 8px 28px; font-size: 0.9rem; }
.btn-primary:hover:not(:disabled) { background: rgba(126,184,247,0.12); }

/* ── shared wizard-step view ── */
.wizard-view {
  flex: 1; display: none; flex-direction: column;
  align-items: center; background: #0a0a14; overflow-y: auto; padding: 20px; gap: 16px;
}
.wizard-view.active { display: flex; }
.wizard-step-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: #555; text-align: center;
}

/* ── select view (Step 1) ── */
.select-controls { display: flex; align-items: center; gap: 10px; }
/* ST-primary layout: single column by default; grows as MEA/Capture B are toggled on */
.select-photos {
  display: grid; grid-template-columns: 1fr; gap: 20px;
  width: 100%; max-width: 640px;
}
.select-photos.mea-visible,
.select-photos.captureb-visible {
  grid-template-columns: 1fr 1fr; max-width: 1100px;
}
.select-photos.mea-visible.captureb-visible {
  grid-template-columns: 1fr 1fr 1fr; max-width: 1500px;
}
/* MEA / Capture B cards hidden until toggled */
.select-photo-card.mea-card, .select-photo-card.captureb-card { display: none; }
.select-photos.mea-visible .select-photo-card.mea-card { display: flex; }
.select-photos.captureb-visible .select-photo-card.captureb-card { display: flex; }

.select-photo-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: #0d0d1e; border: 1px solid #1e1e38; border-radius: 8px; padding: 14px;
}
.select-photo-header { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.img-select { width: 100%; }
.select-img-wrap {
  width: 100%; display: flex; align-items: center; justify-content: center;
  background: #050510; border-radius: 6px; overflow: hidden; min-height: 200px;
}
.select-img { max-width: 100%; max-height: 50vh; object-fit: contain; display: block; transition: transform 0.1s; }
.flip-controls { display: flex; gap: 16px; min-height: 1.4em; align-items: center; }
.flip-controls label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.img-select:disabled { opacity: 0.65; cursor: default; }
/* MEA edge-sharpening pen tool — canvas sits exactly over the <img> via a
   shrink-wrapped relative stage, so pointer coords map 1:1 to image pixels
   with no transform math (see toggleMeaEditPen for why flip preview is
   suspended while editing). */
.mea-edit-stage { position: relative; display: inline-block; max-width: 100%; max-height: 50vh; }
.mea-edit-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.mea-edit-canvas.pen-off { pointer-events: none; }
.mea-edit-canvas.pen-on { pointer-events: auto; cursor: crosshair; }
.mea-edit-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.75rem; }
.btn-small { font-size: 0.72rem; padding: 4px 9px; }
.mea-edit-toggle-btn.mea-edit-on { color: #ff5f7e; border-color: #ff5f7e; }
.mea-edit-size-wrap { display: flex; align-items: center; gap: 6px; color: #888; }
.mea-edit-status { color: #4ade80; }
/* MEA / Capture B toggle buttons */
.mea-toggle-btn { font-size: 0.78rem; color: #555; border-color: #333; }
.mea-toggle-btn.mea-on { color: #7eb8f7; border-color: #7eb8f7; }
.captureb-toggle-btn { font-size: 0.78rem; color: #555; border-color: #333; }
.captureb-toggle-btn.captureb-on { color: #b48cf0; border-color: #b48cf0; }

/* ── pipeline view ── */
.pipe-topbar {
  flex-shrink: 0; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 8px 14px; background: #0d0d1e; border-bottom: 1px solid #1e1e38;
}
.pipe-title { font-size: 0.82rem; color: #555; flex: 1; text-align: center; letter-spacing: 0.06em; text-transform: uppercase; }

#pipe-body { width: 100%; }

.pipe-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 1400px; margin: 0 auto;
}
.pipe-cols.single { grid-template-columns: 1fr; max-width: 700px; }

.pipe-col { display: flex; flex-direction: column; gap: 10px; }

.pipe-col-header {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 0 8px; border-bottom: 2px solid;
  text-align: center;
}
.pipe-col:first-child .pipe-col-header { color: #7eb8f7; border-color: #7eb8f7; }
.pipe-col:last-child  .pipe-col-header { color: #ffa028; border-color: #ffa028; }

.pipe-step { display: flex; flex-direction: column; gap: 5px; }
.pipe-step-label {
  font-size: 0.72rem; color: #7a8aaa; letter-spacing: 0.05em; text-transform: uppercase;
  padding-left: 2px;
}
.pipe-step img {
  width: 100%; border-radius: 6px; display: block;
  border: 1px solid #1e2a3a;
}

.pipe-align-header {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: #aaa; text-align: center; margin-bottom: 12px;
}
.pipe-final-section {
  max-width: 1400px; margin: 20px auto 0; width: 100%;
  border-top: 1px solid #1e1e38; padding-top: 16px;
}
.pipe-final-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pipe-final-cols.single { grid-template-columns: 1fr; max-width: 500px; margin: 0 auto; }
.pipe-final-img { width: 100%; border-radius: 6px; border: 1px solid #1e2a3a; }
.pipe-anim-canvas {
  width: 320px; height: 320px; max-width: 100%;
  background: #06060f; border: 1px solid #1e2a3a; border-radius: 6px;
}
.pipe-anim-stats { font-size: 0.75rem; color: #888; letter-spacing: 0.04em; }
.pipe-continue-row { display: flex; justify-content: center; padding-top: 18px; }
.pipe-anim-row { display: flex; gap: 10px; align-items: center; }
.pipe-score-bar-wrap {
  width: 26px; height: 320px; max-height: 100%; background: #06060f;
  border: 1px solid #1e2a3a; border-radius: 4px; position: relative; overflow: hidden;
}
.pipe-score-bar-fill {
  position: absolute; bottom: 0; left: 0; width: 100%; height: 0%; background: #e05050;
}
.pipe-score-bar-label {
  position: absolute; top: 4px; left: 0; width: 100%; text-align: center;
  font-size: 0.6rem; color: #ccc; text-shadow: 0 1px 2px #000;
}
.pipe-trace-play-btn { margin-top: 4px; }
.pipe-method-cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px; margin-top: 8px; justify-content: center;
}
.pipe-method-card {
  border: 1px solid #1e2a3a; border-radius: 8px; padding: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.pipe-method-card.selected { border-color: #5a9de8; background: #0d1830; }
.pipe-method-desc {
  font-size: 0.68rem; color: #555; line-height: 1.45; text-align: center;
  max-width: 280px; padding: 0 4px;
}
.pipe-method-use-btn { margin-top: 2px; }
/* Manual alignment (Step 2, next to the snug-fit card) — drag/rotate/scale
   the MEA layer onto the Spatial layer directly. */
#pipe-manual-canvas { cursor: grab; touch-action: none; }
#pipe-manual-canvas:active { cursor: grabbing; }
.manual-align-controls { display: flex; flex-direction: column; gap: 8px; font-size: 0.72rem; color: #888; min-width: 150px; }
.manual-align-controls label { display: flex; flex-direction: column; gap: 3px; }
.manual-align-controls input[type=range] { width: 100%; }
.manual-align-label-row { display: flex; justify-content: space-between; align-items: baseline; }
.manual-align-readout-val { color: #5a9de8; font-variant-numeric: tabular-nums; }
.manual-align-btn-row { display: flex; gap: 6px; flex-wrap: wrap; }
.manual-align-status { min-height: 1.2em; color: #4ade80; }

/* ── upload ST panel (Step 1) ── */
.upload-st-panel {
  display: none; flex-direction: column; gap: 10px;
  width: 100%; max-width: 480px;
  background: #0d0d1e; border: 1px solid #1e3a5f; border-left: 3px solid #4ade80;
  border-radius: 8px; padding: 16px 18px;
}
.upload-st-panel.open { display: flex; }
.upload-st-panel label { font-size: 0.75rem; color: #4ade80; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 2px; }
.upload-st-panel input[type=text] {
  width: 100%; background: #060610; border: 1px solid #1e2a3a; border-radius: 5px;
  padding: 7px 10px; color: #eee; font-size: 0.82rem;
}
.upload-st-panel input[type=text]:focus { outline: none; border-color: #4ade80; }
.upload-st-panel input[type=file] { font-size: 0.78rem; color: #aaa; width: 100%; cursor: pointer; }
.upload-st-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#upload-st-status { font-size: 0.75rem; color: #888; }
#upload-st-status.ok  { color: #4ade80; }
#upload-st-status.err { color: #f87171; }
.upload-st-progress { height: 3px; border-radius: 2px; background: #1e2a3a; overflow: hidden; display: none; }
.upload-st-progress.show { display: block; }
.upload-st-progress-fill { height: 100%; background: #4ade80; border-radius: 2px; width: 0; transition: width .2s; }

/* ── two-capture (cloupe × cloupe) alignment step ──
   Full wizard step (between Review and the MEA pipeline/Explore), styled to
   match the pipe-* classes below rather than duplicating that layout. */
.cloupe-align-status { font-size: 0.78rem; color: #888; min-height: 1.2em; }
.cloupe-align-status.ok  { color: #4ade80; }
.cloupe-align-status.err { color: #f87171; }
/* Capture A/B accent colors, matching the Z slider and "A vs B" lasso mode elsewhere */
#cloupe-align-a-col .pipe-col-header { color: #ffa028; border-color: #ffa028; }
#cloupe-align-b-col .pipe-col-header { color: #b48cf0; border-color: #b48cf0; }

/* ── review step (Step 1.5) ── */
.review-photos {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 20px;
  width: 100%; max-width: 1100px; margin: 0 auto;
}
.review-photos .select-photo-card { width: 320px; }

/* ── explore view ── */
#explore-view {
  flex: 1; background: #07071a; display: none; flex-direction: column;
  overflow: hidden;
}
#explore-view.active { display: flex; }
.exp-topbar {
  flex-shrink: 0; height: 42px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; background: #0d0d20; border-bottom: 1px solid #181830;
  position: sticky; top: 0; z-index: 2;
}
#exp-status { font-size: 0.75rem; color: #5a9de8; }
.exp-topbar-hint { margin-left: auto; font-size: 0.68rem; color: #464660; }
.exp-mode-chip {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 10px; border: 1px solid;
  flex-shrink: 0;
}
.exp-mode-chip.st-only   { color: #ffa028; border-color: rgba(255,160,40,.3); background: rgba(255,160,40,.07); }
.exp-mode-chip.st-plus-mea { color: #7eb8f7; border-color: rgba(126,184,247,.3); background: rgba(126,184,247,.07); }
/* Hero + thumbnails: the combined overlay dominates on the left; MEA/Spatial
   form a wide reference column on the right; the detail panel is a drawer
   that slides up from the bottom (over the overlay) only once something
   is pinned, rather than permanently occupying its own row. */
#exp-main          { flex: 1; display: flex; flex-direction: row; min-height: 0; position: relative; }
#exp-secondary-col {
  flex: 0 0 46%; display: flex; flex-direction: column; min-height: 0; min-width: 0;
}
#exp-secondary-col .exp-img-panel { border-right: none; border-bottom: 1px solid #181830; }
#exp-secondary-col .exp-img-panel:last-child { border-bottom: none; }
#exp-anim-panel { flex: 0.7; }
#exp-anim-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  min-height: 0; overflow: hidden;
}
#exp-anim-canvas {
  max-width: 100%; max-height: 100%;
  background: #06060f; border: 1px solid #1e2a3a; border-radius: 6px;
}

/* Image panels (MEA / Spatial) */
.exp-img-panel {
  flex: 1; display: flex; flex-direction: column;
  padding: 5px 7px; gap: 3px; min-width: 0; min-height: 0;
}
.exp-panel-label {
  flex-shrink: 0; font-size: 0.6rem; text-transform: uppercase;
  letter-spacing: 0.13em; color: #2e2e50; text-align: center;
}
#exp-canvas-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  position: relative; min-height: 0; overflow: hidden;
}
#exp-canvas { cursor: crosshair; display: block; }
#exp-colorbar {
  flex-shrink: 0; display: flex; align-items: center; gap: 5px;
  justify-content: center; font-size: 0.65rem; color: #333;
}
#exp-spatial-wrap { flex: 1; position: relative; min-height: 0; overflow: hidden; }
#exp-spatial-img  { width: 100%; height: 100%; object-fit: contain; display: block; }
#exp-spatial-canvas {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; cursor: crosshair;
}
#exp-cluster-legend {
  flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 4px 12px;
  justify-content: center; font-size: 0.62rem; color: #555; padding-top: 1px;
}
.exp-legend-item { display: flex; align-items: center; gap: 4px; }
.exp-legend-swatch { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Projected panel — the combined MEA+Spatial overlay; the dominant "hero" view */
#exp-projected-panel {
  flex: 1; min-width: 0; border-right: 1px solid #181830;
  display: flex; flex-direction: column; min-height: 0;
  padding: 4px 6px; gap: 3px;
}
#exp-projected-wrap  { flex: 1; position: relative; min-height: 0; overflow: hidden; }
#exp-projected-canvas {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; cursor: crosshair;
}
#exp-projected-canvas.lasso-mode { cursor: cell; }
#exp-projected-canvas.bg-move-mode { cursor: move; }

/* Background-image panel — floating overlay in the corner of the projected
   (hero) canvas; imports a reference image from the experiment's directory
   to draw behind the ST dot map, either for visual framing or as a manual
   alignment target for a foreign data format. */
.bg-panel {
  display: none; position: absolute; top: 8px; right: 8px; z-index: 4;
  width: 220px; background: rgba(10,10,22,0.94); border: 1px solid #26264a;
  border-radius: 8px; padding: 10px 12px; gap: 8px; flex-direction: column;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}
.bg-panel.open { display: flex; }
.bg-panel select {
  width: 100%; font-size: 0.72rem; padding: 3px 6px;
}
.bg-panel-row { display: flex; flex-direction: column; gap: 3px; }
.bg-panel-row-inline { display: flex; align-items: center; gap: 6px; }
.bg-panel-lbl {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em; color: #5a6a9a;
}
.bg-panel-lbl span:last-child { color: #7eb8f7; font-variant-numeric: tabular-nums; text-transform: none; letter-spacing: normal; }
.bg-panel input[type=range] { width: 100%; }
.bg-panel-check { font-size: 0.68rem; color: #aaa; display: flex; align-items: center; gap: 5px; cursor: pointer; }

/* Lasso sidebar — persistent narrow rail on the far left of the explore view */
#exp-lasso-sidebar {
  flex: 0 0 230px; display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid #181830; background: #08081a;
}
#lasso-sidebar-head {
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 5px 8px 4px;
}
#lasso-body { flex: 1; overflow-y: auto; padding: 3px 8px; position: relative; }
#lasso-empty { font-size: 0.72rem; line-height: 1.65; color: #2e2e50; padding: 10px 2px; }
#lasso-summary { display: none; }
#lasso-ab-section { display: none; border-top: 1px solid #0f0f1e; margin-top: 4px; padding-top: 4px; }
#lasso-zone-section { display: none; border-top: 1px solid #0f0f1e; margin-top: 4px; padding-top: 4px; }
#lasso-mode-select {
  font-size: 0.62rem; background: #0d0d20; color: #aab; border: 1px solid #24244a;
  border-radius: 3px; padding: 1px 3px; flex-shrink: 0;
}
.lasso-region-head {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 0.7rem; font-weight: 600; padding: 8px 0 3px; margin-top: 4px;
  border-top: 1px solid #0f0f1e;
}
.lasso-region-head:first-child { border-top: none; margin-top: 0; padding-top: 4px; }
.lasso-region-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.lasso-region-dot.uni { background: #4488dd; }
.lasso-region-dot.loc { background: #f0c040; }
.lasso-region-dot.ab  { background: #5eead4; }
.lasso-region-dot.zoneA { background: #ff6ec7; }
.lasso-region-dot.zoneB { background: #a0e548; }
.lasso-region-counts { font-size: 0.62rem; color: #444; font-weight: 400; margin-left: auto; }
.lasso-no-data { font-size: 0.65rem; color: #2a2a4a; padding: 2px 0 4px; }
.lasso-compare-lbl {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: #2a2a4a; padding: 8px 0 4px; border-top: 1px solid #0f0f1e; margin-top: 2px;
}
.lasso-compare-legend { display: flex; gap: 8px; font-size: 0.6rem; text-transform: none; letter-spacing: normal; color: #555; }
.lasso-compare-legend span { display: flex; align-items: center; gap: 3px; }
.lasso-compare-legend i { display: inline-block; width: 10px; height: 6px; border-radius: 1px; }
.lasso-compare-legend i.uni { background: rgba(68,136,221,0.55); }
.lasso-compare-legend i.loc { background: rgba(240,192,64,0.85); }
.lasso-compare-legend i.ab-a { background: rgba(255,160,40,0.55); }
.lasso-compare-legend i.ab-b { background: rgba(180,140,240,0.85); }
.lasso-compare-legend i.zone-a { background: rgba(255,110,199,0.55); }
.lasso-compare-legend i.zone-b { background: rgba(160,229,72,0.85); }
#lasso-clip-warning {
  display: none; font-size: 0.65rem; color: #c8882a;
  background: rgba(200,136,42,0.12); border: 1px solid rgba(200,136,42,0.3);
  border-radius: 3px; padding: 3px 6px; margin: 4px 0;
}
#lasso-toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: #1e1a10; border: 1px solid #c8882a; color: #f0a840;
  font-size: 0.78rem; padding: 7px 16px; border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.6); pointer-events: none;
  opacity: 0; transition: opacity 0.2s, transform 0.2s; z-index: 999;
}
#lasso-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
#lasso-gene-status { font-size: 0.6rem; text-transform: none; letter-spacing: normal; color: #444; }
.lasso-cluster-row {
  display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 0.7rem; color: #888;
}
.lasso-cluster-name {
  flex-shrink: 0; width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #777;
}
.lasso-cluster-bar-track {
  flex: 1; height: 5px; background: #141428; border-radius: 3px; overflow: hidden;
}
.lasso-cluster-bar { display: block; height: 100%; border-radius: 3px; }
.lasso-cluster-n { flex-shrink: 0; min-width: 26px; text-align: right; color: #555; font-variant-numeric: tabular-nums; }
#lasso-gene-chart, #lasso-ab-gene-chart, #lasso-zone-gene-chart { width: 100%; display: block; margin-top: 4px; }
.lasso-csv-btn { font-size: 0.6rem; padding: 3px 8px; margin-top: 6px; width: 100%; }

/* Loading spinner shown while gene-aggregate fetch is in flight */
#lasso-loading {
  display: none; position: absolute; inset: 0; z-index: 5;
  background: rgba(8,8,26,0.78); backdrop-filter: blur(2px);
  flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
#lasso-loading.active { display: flex; }
.lasso-spinner {
  width: 28px; height: 28px; border: 3px solid #1a1a35;
  border-top-color: #5a9de8; border-radius: 50%;
  animation: lasso-spin 0.75s linear infinite;
}
@keyframes lasso-spin { to { transform: rotate(360deg); } }
#lasso-loading-txt { font-size: 0.7rem; color: #5a9de8; }

/* Detail panel — a drawer that slides up from the bottom-left (over the overlay
   panel) only once an electrode or spot is pinned; see updateDetailVisibility(). */
#exp-detail-panel {
  position: absolute; left: 230px; right: 46%; bottom: 0; height: 230px; z-index: 3;
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  background: #0d0d20; border-top: 1px solid #181830; border-right: 1px solid #181830;
  box-shadow: 0 -10px 28px rgba(0,0,0,0.45);
  transform: translateY(100%); transition: transform 0.22s ease;
}
#exp-detail-panel.exp-detail-active { transform: translateY(0); }
#exp-detail-header {
  flex-shrink: 0; display: flex; gap: 0; border-bottom: 1px solid #181830;
}
.exp-detail-col {
  flex: 1; padding: 5px 12px; display: flex; flex-direction: column; gap: 1px;
}
.exp-detail-col + .exp-detail-col { border-left: 1px solid #181830; }
.exp-detail-lbl { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.12em; color: #3a5070; }
.exp-detail-val { font-size: 0.8rem; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#exp-detail-body { flex: 1; position: relative; min-height: 0; background: #05050f; }
#exp-trace, #exp-gene-chart {
  position: absolute; inset: 0; width: 100%; height: 100%; display: none;
}
/* Universal time bar — prominent, always visible, drives electrode colour
   coding (and the pinned-electrode trace window) from one shared clock. */
#exp-time-bar {
  flex-shrink: 0; display: flex; align-items: center; gap: 14px;
  padding: 10px 20px; background: #0d0d20; border-bottom: 1px solid #181830;
}
.exp-time-lbl {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.18em;
  color: #5a9de8; flex-shrink: 0;
}
#exp-play-btn.exp-play-active { background: #5a9de8; color: #07071a; border-color: #5a9de8; }
#exp-time-slider { flex: 1; accent-color: #5a9de8; cursor: pointer; height: 16px; }
#exp-time-readout { min-width: 190px; text-align: right; font-size: 0.8rem; color: #5a9de8; }
