
/* ======================================================
   Baseline
   ====================================================== */
:root {
  --topbar-h: 52px;
  --panel-header-h: 40px;
  --ctrl-top: calc(var(--topbar-h) + var(--panel-header-h) + 12px);
  --right-panel-w: 50vw;
}

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

#app-root {
  width: 100vw;
  height: 100vh;
  background: #000019;
}

/* ======================================================
   Split-screen layout
   ====================================================== */
#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: #0a0c1b;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  z-index: 3600;
  box-sizing: border-box;
}

#panel-right {
  position: fixed;
  top: var(--topbar-h);
  right: 0;
  bottom: 0;
  width: var(--right-panel-w);
  background: #07091a;
  border-left: 1px solid rgba(255,255,255,0.10);
  z-index: 1800;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#panel-header-left {
  position: fixed;
  top: calc(var(--topbar-h) + 6px);
  left: 0;
  right: var(--right-panel-w);
  height: var(--panel-header-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  z-index: 3000;
  box-sizing: border-box;
  padding: 0 4px;
  pointer-events: none;
}

#panel-header-right {
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  height: var(--panel-header-h);
  display: flex;
  align-items: center;
  gap: 0;
  box-sizing: border-box;
  padding: 0 8px;
  z-index: 2;
  pointer-events: none;
}

#panel-right-body {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

#split-divider {
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  right: var(--right-panel-w);
  width: 8px;
  transform: translateX(50%);
  cursor: col-resize;
  z-index: 3100;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

#split-divider:hover {
  background: rgba(255,255,255,0.18);
}

#split-reopen-btn {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 20px;
  height: 56px;
  background: rgba(30,32,52,0.92);
  border: 1px solid rgba(255,255,255,0.2);
  border-right: none;
  border-radius: 6px 0 0 6px;
  cursor: pointer;
  z-index: 1900;
  align-items: center;
  justify-content: center;
}

#split-reopen-btn:hover {
  background: rgba(50,55,90,0.95);
}

.split-reopen-arrow {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 7px solid rgba(255,255,255,0.7);
}

#split-reopen-left-btn {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 20px;
  height: 56px;
  background: rgba(30,32,52,0.92);
  border: 1px solid rgba(255,255,255,0.2);
  border-left: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  z-index: 1900;
  align-items: center;
  justify-content: center;
}

#split-reopen-left-btn:hover {
  background: rgba(50,55,90,0.95);
}

.split-reopen-left-arrow {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid rgba(255,255,255,0.7);
}

/* When left area is snapped closed, hide left-side elements */
body.left-snapped #control-stack,
body.left-snapped #btn-collapse-controls,
body.left-snapped #panel-header-left,
body.left-snapped #graph-wrapper,
body.left-snapped #cell-selector-page {
  display: none !important;
}

body.left-snapped #panel-right {
  z-index: 4000;
}

body.left-snapped #split-reopen-left-btn {
  z-index: 4100;
}

/* Hide split panel and controls on landing page */
body.on-landing #panel-right,
body.on-landing #split-divider,
body.on-landing #split-reopen-btn,
body.on-landing #split-reopen-left-btn,
body.on-landing #panel-header-left,
body.on-landing #control-stack,
body.on-landing #btn-collapse-controls,
body.on-landing #ctrl-stack-right,
body.on-landing #btn-collapse-controls-right {
  display: none !important;
}
/* On landing: show chip row (lives in #top-bar); hide the normal center */
body.on-landing #landing-chips-row {
  display: flex;
}
body.on-landing #top-bar-center {
  display: none !important;
}
/* On landing: swap the shared nav buttons for dedicated always-enabled ones */
#cs-btn-back, #cs-btn-home {
  display: none !important;
}
body.on-landing #btn-back,
body.on-landing #btn-home {
  display: none !important;
}
body.on-landing #cs-btn-back,
body.on-landing #cs-btn-home {
  display: inline-flex !important;
}

#graph {
  width: 100%;
  height: 100%;
}

/* ======================================================
   Panel skin
   ====================================================== */
.popover {
  background-color: #141726;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--scuba-muted);
}


/* ======================================================
   Controls stack
   ====================================================== */
#control-stack {
  top: var(--ctrl-top);
  display: flex;
  flex-direction: column;
}

#btn-collapse-controls {
  top: var(--ctrl-top);
}

#search-wrap,
#search-wrap *,
#my-multi-dropdown,
#my-multi-dropdown * {
  pointer-events: auto !important;
}

/* ── Input / dropdown icons ─────────────────────────────────────── */
.input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity: 1;
  pointer-events: none;
  z-index: 2;
}

#search-input-container #search-input {
  padding-left: 32px !important;
}

#palette-icon {
  z-index: 4001;
}

#my-multi-dropdown .dash-dropdown-trigger {
  padding-left: 32px !important;
  padding-right: 4px !important;
}

/* ======================================================
   Custom search input
   ====================================================== */

/* dbc.Input renders <input id="search-input" class="form-control"> directly */
#search-input,
#search-input:focus,
#search-input:active,
#search-input:focus-visible {
  width: calc(10ch + 56px);
  height: 100%;
  box-sizing: border-box;
  color: var(--scuba-muted) !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 5px 24px 5px 10px;
  font-size: 13px;
  font-weight: 400;
  outline: none !important;
  box-shadow: none !important;
  caret-color: var(--scuba-text);
  transition: width 0.18s ease, opacity 0.12s ease, padding 0.18s ease;
}

#btn-clear-search {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--bs-secondary-color, rgba(255,255,255,0.5));
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  z-index: 1;
}

#btn-clear-search:hover {
  color: var(--bs-body-color, rgba(255,255,255,0.9));
}

#search-input::placeholder {
  color: var(--scuba-muted);
  font-weight: 400;
  opacity: 1;
}

/* Search results dropdown */
#search-results {
  position: absolute;
  top: 100%;
  left: 7;
  right: 7;
  max-height: 450px;
  overflow-y: auto;
  margin-top: 4px;
  background: #141726;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  z-index: 5000;
}

#search-results:empty {
  display: none;
}

.search-result-item {
  color: #bbb;
  padding: 1px 10px;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  border-radius: 4px;
  margin: 1px 4px;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #bbb;
}

/* ======================================================
   Category dropdown (my-multi-dropdown)
   ====================================================== */
#my-multi-dropdown {
  width: 100%;
  max-width: 100%;
  background-color: #141726 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 4px !important;
  box-sizing: border-box !important;
  min-height: 3.4vw !important;
  z-index: 4000 !important;
  color: #ffffff !important;
}

#my-multi-dropdown,
#my-multi-dropdown * {
  outline: none !important;
  box-shadow: none !important;
}

#my-multi-dropdown:focus-within {
  border-color: rgba(255, 255, 255, 0.4) !important;
}

/* Trigger text */
#my-multi-dropdown .dash-dropdown-trigger,
#my-multi-dropdown [class*="singleValue"],
#my-multi-dropdown [class*="placeholder"],
#my-multi-dropdown span {
  color: #ddd !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

#my-multi-dropdown input {
  color: #ffffff !important;
}

/* Arrow + clear X */
#my-multi-dropdown svg {
  fill: #DDD !important;
  color: #DDD !important;
}

#my-multi-dropdown [class*="indicatorContainer"] svg {
  fill: #DDD !important;
}

#my-multi-dropdown [class*="clearIndicator"],
#my-multi-dropdown [class*="dropdownIndicator"] {
  color: #DDD !important;
  padding: 4px !important;
}

#my-multi-dropdown [class*="indicatorContainer"] {
  padding: 0 6px !important;
}

/* Popover menu */
.dash-dropdown-content {
  background-color: #141726 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 4px !important;
  padding: 4px !important;
  z-index: 9999 !important;
  color: #ddd !important;
  width: 280px !important;
  min-width: 280px !important;
  max-width: 280px !important;
  max-height: 450px !important;
  box-sizing: border-box !important;
}

/* Options */
.dash-dropdown-options {
  padding: 2px !important;
}

.dash-dropdown-option {
  color: #ddd !important;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 400;
  padding: 4px 10px;
}


.dash-dropdown-option:hover,
.dash-dropdown-option[data-highlighted] {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
}

.dash-dropdown-option[aria-selected="true"] {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
}

/* ======================================================
   Inline edit panel (in info box)
   ====================================================== */
#edit-panel label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  display: block;
  margin-bottom: 2px;
  margin-top: 6px;
}

#edit-panel label:first-child {
  margin-top: 0;
}

#edit-panel .dash-input-container,
#edit-panel .dash-input {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

#edit-panel .dash-input-element {
  width: 100%;
  box-sizing: border-box;
  color: var(--scuba-text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
  outline: none !important;
  box-shadow: none !important;
}

#edit-panel .dash-input-element:focus {
  border-color: rgba(255, 255, 255, 0.4) !important;
  background: rgba(255, 255, 255, 0.12);
}

#btn-save-edit {
  flex: 1;
  background: rgba(50, 140, 70, 0.35);
  border: 1px solid rgba(80, 180, 100, 0.5);
  border-radius: 4px;
  color: rgba(150, 230, 150, 0.9);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

#btn-save-edit:hover {
  background: rgba(50, 140, 70, 0.55);
}

#btn-delete-node {
  flex: 1;
  background: rgba(140, 40, 40, 0.35);
  border: 1px solid rgba(180, 80, 80, 0.5);
  border-radius: 4px;
  color: rgba(230, 130, 130, 0.9);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

#btn-delete-node:hover {
  background: rgba(140, 40, 40, 0.55);
}

#delete-confirm-panel {
  margin-top: 6px;
}

#delete-confirm-text {
  font-size: 11px;
  color: rgba(230, 150, 150, 0.9);
  margin-bottom: 6px;
  text-align: center;
}

#btn-delete-cancel {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  color: var(--scuba-text);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

#btn-delete-confirm {
  flex: 1;
  background: rgba(140, 40, 40, 0.5);
  border: 1px solid rgba(180, 80, 80, 0.6);
  border-radius: 4px;
  color: rgba(230, 130, 130, 1.0);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

#edit-status {
  font-size: 11px;
  color: rgba(100, 200, 100, 0.8);
  margin-top: 4px;
  min-height: 14px;
}

/* ======================================================
   Popovers
   ====================================================== */
.popover {
  position: fixed;
  z-index: 100000;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 12px;
  white-space: normal;
  overflow-wrap: anywhere;
  display: none;
  max-width: none;
}

#info-box {
  top: var(--topbar-h);
  right: 15px;
  left: auto;
  width: 300px;
  max-height: 38vw;
  overflow-y: auto;
}

#help-popover {
  padding: 0;
}

#function-drawer {
  top: var(--topbar-h);
  right: 15px;
  left: auto;
  width: 300px;
  overflow: hidden;
}

/* ── Gene card layout ──────────────────────────────── */
.info-symbol-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 6px;
  margin-bottom: 2px;
}

#info-gene-symbol {
  font-size: 16px;
  white-space: nowrap;
}

.info-synonym {
  font-size: 12px;
  opacity: 0.65;
}

.info-name {
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 6px;
}

/* ── Module card layout ────────────────────────────── */
.info-module-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ── Shared: action buttons row — pinned to card bottom ── */
.info-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
  flex-shrink: 0;
}

.info-actions button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Show-more toggle ───────────────────────────────── */
.info-show-more {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #ccc;
  padding: 6px 0 2px;
  user-select: none;
  flex-shrink: 0;
}
.info-show-more:hover { color: #eee; }
.info-chevron {
  display: inline-block;
  font-size: 10px;
  font-weight: 400;
  color: var(--scuba-muted);
  transition: transform 0.18s ease;
  line-height: 1;
}
.info-show-more:hover .info-chevron { color: #aaa; }
.info-show-more.open .info-chevron { transform: rotate(180deg); }
.info-expandable { display: none; }
.info-expandable.open { display: block; }

/* ── Preferences modal inputs ────────────────────────── */
#ud-settings-modal input:focus,
#ud-settings-modal input:focus-visible {
  border-color: rgba(255,255,255,0.6) !important;
  outline: none !important;
  box-shadow: none !important;
}
#ud-settings-modal input::placeholder {
  color: var(--scuba-muted) !important;
}

#hpa-link,
#ot-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* ======================================================
   Panel header left — chip / dropdown styling
   ====================================================== */
.panel-type-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--scuba-muted);
  text-transform: uppercase;
  padding: 0 10px 0 6px;
  flex-shrink: 0;
  white-space: nowrap;
  opacity: 0.6;
}
.graph-title-chip {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 400;
  color: var(--scuba-muted);
  background: #141726;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 4px 13px;
  white-space: nowrap;
}
.graph-title-chip--ct {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 11px 2px 5px;
}
.graph-title-chip-icon {
  height: 24px;
  width: 24px;
  object-fit: contain;
  flex-shrink: 0;
}
/* Color-by dropdown in left panel header — compact chip appearance */
#panel-header-left #my-multi-dropdown {
  min-width: 155px;
  font-size: 13px;
}
#panel-header-left #my-multi-dropdown .Select-control {
  border-radius: 4px 0 0 4px;
  border-right: none;
}
#panel-header-right {
  align-items: center;
  position: relative;
  gap: 6px;
}

#panel-header-right #umap-title-chip {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  cursor: default;
  align-items: center;
}

/* ── Right panel type selector ───────────────────────────────────────────── */
#right-panel-type-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 0 4px;
  pointer-events: auto;
}

#right-panel-type-selector .form-check {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

#right-panel-type-selector .form-check-input {
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

#right-panel-type-selector .form-check-label {
  color: var(--scuba-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  margin: 0;
  user-select: none;
}

#panel-right-network-controls {
  pointer-events: auto;
}

/* Right panel network controls (chip group in header) */
#panel-right-network-controls {
  display: none;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

#panel-right-chip-group {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
}

/* Right ctrl-stack mirrors left — right-edge aligned */
#ctrl-stack-right {
  top: var(--ctrl-top);
  background: #141726;
  border: 0.5px solid #373A46;
  overflow-y: auto;
  overflow-x: hidden;
}

#btn-collapse-controls-right {
  top: var(--ctrl-top);
}

/* Suppress separator on right color-control-wrap, same as left */
#color-control-wrap-right::before { display: none !important; }

/* Right-panel-specific size-legend layout mirrors left */
#size-legend-m-right .ctrl-legend-items {
  width: 100%;
  justify-content: space-between;
  gap: 0;
}

#size-legend-m-right .ctrl-legend-item {
  flex: 1;
  justify-content: center;
}

/* ── Upload page: sunburst card fills right column height ────────── */
#ud-chart-card {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* ── Upload page accordion — dark theme ──────────────────────────── */
.ud-upload-accordion {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  border: 0.5px solid #373A46;
  background-color: #141726;
}

.ud-upload-accordion .accordion-item {
  background-color: #141726;
  border-color: #373A46;
  flex-shrink: 0;
}

/* Any open item fills remaining space */
.ud-upload-accordion .accordion-item:has(.accordion-collapse.show) {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ud-upload-accordion .accordion-collapse.show {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ud-upload-accordion .accordion-body {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 20px 16px;
  background-color: #141726;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.ud-upload-accordion .accordion-button {
  background-color: #141726;
  color: #ddd;
  font-size: 12px;
  font-weight: 600;
  padding: 13px 20px;
  box-shadow: none !important;
}

.ud-upload-accordion .accordion-button:not(.collapsed) {
  background-color: #141726;
  color: #ddd;
}

.ud-upload-accordion .accordion-button:focus {
  border-color: transparent;
}

.ud-upload-accordion .accordion-button::after,
.ud-upload-accordion .accordion-button:not(.collapsed)::after {
  filter: invert(0.65);
}

/* ======================================================
   Top bar layout
   ====================================================== */
#top-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
}

#nav-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,0.10);
  padding-right: 4px;
  margin-right: 2px;
}

#top-bar-center {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-shrink: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}


#top-bar .nav-btn,
#nav-bar .btn {
  --bs-btn-color:        var(--bs-body-color);
  --bs-btn-hover-color:  #fff;
  --bs-btn-active-color: #fff;
  --bs-btn-focus-box-shadow: none;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  width: 28px;
  height: 28px;
  padding: 0;
  flex-shrink: 0;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#top-bar .nav-btn:disabled,
#nav-bar .btn:disabled,
#top-bar .nav-btn.disabled,
#nav-bar .btn.disabled {
  opacity: 0.25 !important;
  cursor: default !important;
}

#top-bar .nav-btn:disabled:hover,
#nav-bar .btn:disabled:hover,
#top-bar .nav-btn:disabled *,
#nav-bar .btn:disabled * {
  background-color: transparent !important;
}

#top-bar .nav-btn img,
#nav-bar img {
  width: 13px;
  height: 13px;
  display: block;
}

#search-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  z-index: 5000;
  transition: background 0.1s, border-color 0.1s;
}

/* Collapsed: icon-only nav-button appearance */
#search-wrap:not(.search-open) {
  width: 28px;
  height: 28px;
  overflow: hidden;
}
#search-wrap:not(.search-open) #search-input-container {
  width: 28px;
  height: 28px;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
}
#search-wrap:not(.search-open) #search-input-container:hover {
  background-color: var(--hover-bg) !important;
}
#search-wrap:not(.search-open) .input-icon {
  position: static;
  transform: none;
  left: auto;
  pointer-events: auto;
  cursor: pointer;
}
#search-wrap:not(.search-open) #search-input {
  width: 0 !important;
  padding: 0 !important;
  opacity: 0;
  pointer-events: none;
}
#search-wrap:not(.search-open) #btn-clear-search {
  display: none !important;
}
#search-wrap:not(.search-open) #search-results {
  display: none !important;
}

/* Expanded */
#search-wrap.search-open {
  border-color: rgba(255,255,255,0.15);
  background: #1a1d2e;
}
#search-wrap.search-open:hover,
#search-wrap.search-open:focus-within {
  background: #282f48;
  border-color: rgba(255,255,255,0.4);
}

#search-input-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

#byo-ctrl-section {
  display: none !important;
}

/* Upload-page datasource collapse body — scrollable flex column */
.ud-file-body {
  scrollbar-width: thin;
  scrollbar-color: var(--sb-thumb) transparent;
}
.ud-file-body::-webkit-scrollbar { width: 4px; }
.ud-file-body::-webkit-scrollbar-track { background: transparent; }
.ud-file-body::-webkit-scrollbar-thumb { background: var(--sb-thumb); border-radius: 2px; }

/* Upload-page history list — scrollable with standard SCUBA scrollbar */
.ud-history-list {
  flex: 1 1 0;
  min-height: 60px;
  overflow-y: auto;
  background-color: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  padding: 4px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--sb-thumb) transparent;
}
.ud-history-list::-webkit-scrollbar { width: 4px; }
.ud-history-list::-webkit-scrollbar-track { background: transparent; }
.ud-history-list::-webkit-scrollbar-thumb { background: var(--sb-thumb); border-radius: 2px; }

/* Upload-page flat buttons — kills all Bootstrap gradients, colors, shadows */
.ud-flat-btn {
  font-size: 11px !important;
  font-weight: 400 !important;
  color: var(--scuba-muted) !important;
  background-color: #1e2236 !important;
  background-image: none !important;
  border: 1px solid rgba(255,255,255,0.28) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  padding: 5px 10px !important;
  opacity: 1 !important;
}
.ud-flat-btn:hover {
  background-color: #282f48 !important;
  background-image: none !important;
  color: var(--scuba-muted) !important;
}
.ud-flat-btn:focus,
.ud-flat-btn:active {
  background-color: #282f48 !important;
  background-image: none !important;
  color: var(--scuba-muted) !important;
  box-shadow: none !important;
  outline: none !important;
}
.ud-flat-btn:disabled,
.ud-flat-btn[disabled] {
  background-color: #1e2236 !important;
  background-image: none !important;
  color: var(--scuba-muted) !important;
  opacity: 0.45 !important;
  cursor: not-allowed !important;
}

.contcb-card {
  padding: 8px;
  border-radius: 4px;
}

.contcb-title {
  font-size: 12px;
  text-align: center;
  margin-bottom: 6px;
  color: var(--scuba-muted);
}

.contcb-txt {
  font-size: 11px;
  text-align: center;
  color: var(--scuba-muted);
}

.contcb-bar {
  height: 220px;
  width: 12px;
  margin: 0 auto;
  border-radius: 4px;
  border: 1px solid #222;
}

/* ======================================================
   Function drawer
   ====================================================== */
#function-drawer .drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#function-drawer-title {
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 10px;
}

.btn-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.btn-close:hover {
  color: #fff;
}

/* ── Floating info card ─────────────────────────────────── */
.panel-drag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  height: 30px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: move;
  user-select: none;
}


/* ── 8 resize handles (injected by panel_resize.js) ────── */
.panel-rh {
  position: absolute;
  z-index: 20;
}
.panel-rh-nw { top: 0;    left: 0;   width: 10px; height: 10px; cursor: nw-resize; }
.panel-rh-ne { top: 0;    right: 0;  width: 10px; height: 10px; cursor: ne-resize; }
.panel-rh-sw { bottom: 0; left: 0;   width: 10px; height: 10px; cursor: sw-resize; }
.panel-rh-se { bottom: 0; right: 0;  width: 10px; height: 10px; cursor: se-resize; }
.panel-rh-n  { top: 0;    left: 10px; right: 10px; height: 5px;  cursor: n-resize; }
.panel-rh-s  { bottom: 0; left: 10px; right: 10px; height: 5px;  cursor: s-resize; }
.panel-rh-w  { top: 10px; bottom: 10px; left: 0;   width: 5px;   cursor: w-resize; }
.panel-rh-e  { top: 10px; bottom: 10px; right: 0;  width: 5px;   cursor: e-resize; }

#function-drawer-body {
  padding: 12px;
  overflow-y: auto;
  max-height: calc(90vh - 52px);
  white-space: pre-wrap;
  line-height: 1.35;
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* ======================================================
   Landing page
   ====================================================== */
#cell-selector-page {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

#landing-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 1200px;
  height: 100%;
  padding: 15px 32px 10px;
  box-sizing: border-box;
  gap: 6px;
  overflow: hidden;
}


#landing-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
}

#landing-chips-row {
  display: none;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 0;
}
/* Lock chip widths to their widest option so they never reflow on selection.
   Static chips: formula max(cat_chars×7, val_chars×9)+42px.
   Dynamic chips (splitby, contrast): width set via CSS variable by a clientside callback. */
#landing-chip-disease  { min-width:  91px !important; }
#landing-chip-metric   { min-width: 222px !important; }
#landing-chip-readout  { min-width: 186px !important; }
#ud-chip-splitby, #landing-chip-splitby   { min-width: var(--splitby-chip-min-width,  auto) !important; }
#landing-chip-ud-contrast                 { min-width: var(--contrast-chip-min-width, auto) !important; }
/* All landing chips: 1px right border (overrides z_overrides.css 2px at higher specificity) */
#landing-chip-disease .btn,
#landing-chip-metric .btn,
#landing-chip-readout .btn,
#landing-chip-dataset .btn,
#landing-chip-ud-contrast .btn,
#landing-chip-splitby .btn {
  border-right-width: 1px !important;
}
#landing-chip-disease .btn {
  border-left: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 4px 0 0 4px !important;
}
#landing-chip-readout .btn {
  border-left: none !important;
  border-radius: 0 4px 4px 0 !important;
}
/* Dataset chip is leftmost in ud-mode — round left edge */
#landing-chip-dataset .btn {
  border-left: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 4px 0 0 4px !important;
}
/* Contrast and split-by: right border only, no left edge */
#landing-chip-ud-contrast .btn,
#landing-chip-splitby .btn {
  border-left: none !important;
}

#landing-chart-frame {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 20px;
  opacity: 0;
  transition: opacity 0.12s ease;
}

#landing-chart {
  cursor: default;
}

#landing-cell-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding-top: 10px;
  padding-bottom: 12px;
  flex-shrink: 0;
  box-sizing: border-box;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.15s;
}

.landing-cat-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: opacity 0.2s;
}

.landing-cat-cells {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex: 1;
  min-width: 0;
}

.landing-svg-slot {
  flex: 1;
  min-width: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.2s;
}

.landing-svg-img {
  display: block;
  opacity: 0.75;
  transition: opacity 0.15s;
}

.landing-svg-slot:hover .landing-svg-img {
  opacity: 1;
}

.landing-svg-label {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
}

.landing-cat-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  font-size: 11px;
  font-weight: 400;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  margin-top: 6px;
  pointer-events: none;
}

.landing-cat-label::before {
  content: '';
  align-self: stretch;
  height: 5px;
  margin: 0 2px 4px;
  border-bottom: 1px solid #999;
  border-left: 1px solid #999;
  border-right: 1px solid #999;
}

/* Split-by select: replace Bootstrap's dark chevron with a muted-tone one */
#ud-splitby-select.form-select {
  --bs-form-select-bg-img: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='%23888' stroke-width='2' d='m2 5 6 6 6-6'/></svg>");
}

