:root {
  --site-nav-bg: rgb(248 250 252 / 92%);
  --site-nav-text: #17385e;
  --site-nav-muted: #5b7187;
  --site-pink: #c74369;
}

html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

.portal-navbar {
  min-height: 70px;
  border-bottom: 3px solid #c95373;
  background: var(--site-nav-bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 2px 12px rgb(16 44 68 / 9%);
}

.portal-nav-shell { width: min(100% - 48px, 1600px); }

.portal-navbar .navbar-brand,
.portal-navbar .navbar-brand:hover,
.portal-navbar .marker-brand-copy strong { color: var(--site-nav-text); }
.portal-navbar .marker-brand-copy small { color: var(--site-nav-muted); }
.portal-navbar .marker-brand-logo { width: 39px; }
.portal-navbar .navbar-collapse { flex-grow: 0; margin-left: clamp(40px, 6vw, 100px); }
.portal-navbar .marker-nav-links { margin-left: 0 !important; }

.portal-navbar .marker-nav-links .nav-link,
.portal-navbar .marker-nav-links .portal-dataset-link {
  min-height: 47px;
  padding: .55rem .78rem .45rem;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--site-nav-text);
  font-weight: 720;
}

.portal-navbar .marker-nav-links .nav-link.active,
.portal-navbar .marker-nav-links .nav-link:hover,
.portal-navbar .marker-nav-links .nav-link:focus-visible {
  border-bottom-color: var(--site-pink);
  background: transparent;
  color: var(--site-pink);
}

.portal-header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: clamp(220px, 24vw, 420px);
  height: 36px;
  margin-left: auto;
  padding: 0 13px;
  border-radius: 21px;
  background: #162b3c;
}

.portal-header-search svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: #a5b7c6;
  stroke-width: 1.8;
}

.portal-header-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f5f8fb;
  font-size: .78rem;
}

.portal-header-search input::placeholder { color: #a2b2c0; }
.portal-header-search:focus-within { outline: 2px solid #79b6d1; }

.portal-theme-toggle {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #c8d5df;
  border-radius: 50%;
  background: #eff4f7;
  color: #31566e;
  transition: background-color .16s ease, border-color .16s ease;
}

.portal-theme-toggle:hover { border-color: #8eb5c6; background: #e3edf1; }
.portal-theme-toggle:focus-visible { outline: 3px solid #69b9d1; outline-offset: 2px; }
.portal-theme-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.portal-theme-moon { display: none; }
html[data-theme="dark"] .portal-theme-sun { display: none; }
html[data-theme="dark"] .portal-theme-moon { display: block; }

.portal-language-switch {
  min-height: 37px;
  border-color: #c7d4de;
  color: var(--site-nav-text);
}
.portal-language-switch:hover { color: var(--site-pink); }
.portal-dataset-toggle { color: var(--site-nav-text); }

.portal-navbar .navbar-toggler { border-color: #b9cad7; }
.portal-navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%2317385e' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

html[data-theme="dark"] {
  --site-nav-bg: rgb(16 37 56 / 92%);
  --site-nav-text: #e4eef6;
  --site-nav-muted: #a1b8c9;
  --site-pink: #e77b9a;
  --bioatlas-ink: #e3edf5;
  --bioatlas-muted: #a6b8c8;
  --bioatlas-line: #395064;
  --bioatlas-surface: #1b3040;
  --bioatlas-soft: #162a3a;
  --marker-ink: #e2edf5;
  --marker-muted: #abc0ce;
  --marker-line: #3b5263;
  --marker-canvas: #10202e;
  --marker-cyan-soft: #193e4b;
  --marker-navy: #dcecf6;
}

html[data-theme="dark"] body,
html[data-theme="dark"] #main-content { background: #10202e; color: #e2edf5; }
html[data-theme="dark"] .portal-navbar { box-shadow: 0 3px 15px rgb(0 0 0 / 18%); }
html[data-theme="dark"] .portal-header-search { background: #081926; }
html[data-theme="dark"] .portal-theme-toggle { border-color: #55718a; background: #29465d; color: #eff8ff; }
html[data-theme="dark"] .portal-theme-toggle:hover { background: #355570; }
html[data-theme="dark"] .portal-language-switch { border-color: #496579; color: #dcebf5; }
html[data-theme="dark"] .portal-navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%23dcebf5' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

html[data-theme="dark"] .portal-footer,
html[data-theme="dark"] .page-band,
html[data-theme="dark"] .marker-console-heading,
html[data-theme="dark"] .dataset-catalog-intro,
html[data-theme="dark"] .dataset-organ-sidebar,
html[data-theme="dark"] .dataset-catalog-results,
html[data-theme="dark"] .dataset-overview-hero,
html[data-theme="dark"] .dataset-abstract-panel,
html[data-theme="dark"] .dataset-information-panel,
html[data-theme="dark"] .dataset-source-panel,
html[data-theme="dark"] .dataset-stat-grid,
html[data-theme="dark"] .dataset-preview-panel,
html[data-theme="dark"] .dataset-download-panel,
html[data-theme="dark"] .marker-filter-panel,
html[data-theme="dark"] .marker-table-shell,
html[data-theme="dark"] .marker-note,
html[data-theme="dark"] .about-overview,
html[data-theme="dark"] .about-member,
html[data-theme="dark"] .home-hub-metric,
html[data-theme="dark"] .home-hub-explore,
html[data-theme="dark"] .home-featured-card,
html[data-theme="dark"] .home-hub-list,
html[data-theme="dark"] .search-panel,
html[data-theme="dark"] .dataset-card,
html[data-theme="dark"] .pi-panel,
html[data-theme="dark"] .member-card,
html[data-theme="dark"] .control-bar,
html[data-theme="dark"] .plot-surface,
html[data-theme="dark"] .atlas-preview,
html[data-theme="dark"] .card,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .modal-content {
  border-color: #3b5263;
  background: #1b3040;
  color: #e3edf5;
  box-shadow: none;
}

html[data-theme="dark"] .home-hub { background: #10202e; }
html[data-theme="dark"] .home-hub-body,
html[data-theme="dark"] .dataset-reference-page,
html[data-theme="dark"] .marker-console,
html[data-theme="dark"] .about-page { background: #10202e; color: #e2edf5; }

html[data-theme="dark"] :is(
  .page-band h1, .marker-console-heading h1, .dataset-results-toolbar h2,
  .dataset-organ-sidebar h2, .dataset-overview-title-block h2, .dataset-panel-heading h2,
  .about-overview h1, .about-section-heading h2, .about-member h3,
  .home-hub-section-heading h2, .home-hub-list-heading h2, .marker-stat-line strong,
  .dataset-breadcrumb [aria-current="page"], .marker-cell-name
) { color: #eaf3f9; }

html[data-theme="dark"] :is(
  .marker-subtitle, .dataset-results-toolbar > span, .dataset-overview-id,
  .dataset-panel-heading > span, .dataset-breadcrumb li, .about-member-affiliation,
  .about-introduction, .about-member-bio, .home-hub-muted,
  .home-featured-body p, .home-hub-list-item small
) { color: #afc1cf; }

html[data-theme="dark"] :is(.dataset-catalog-item, .marker-table td, .marker-table th, .dataset-preview-table td, .dataset-preview-table th) {
  border-color: #3b5263;
  background: #1b3040;
  color: #e2edf5;
}

html[data-theme="dark"] .dataset-catalog-item:hover,
html[data-theme="dark"] .dataset-catalog-item:focus-visible,
html[data-theme="dark"] .dataset-catalog-item:active { background: #263f51; }
html[data-theme="dark"] .dataset-organ-option { border-color: #375062; color: #c9d9e5; }
html[data-theme="dark"] .dataset-organ-option b,
html[data-theme="dark"] .dataset-overview-tags span,
html[data-theme="dark"] .dataset-search-clear,
html[data-theme="dark"] .dataset-stat-grid > div { background: #263f51; color: #dcebf5; border-color: #496579; }
html[data-theme="dark"] .dataset-search-control,
html[data-theme="dark"] .marker-field .form-control,
html[data-theme="dark"] .marker-field .form-select,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select { border-color: #516a7d; background-color: #132838; color: #e5f0f7; }
html[data-theme="dark"] .dataset-search-control input,
html[data-theme="dark"] .marker-field > span:first-child { color: #e5f0f7; }
html[data-theme="dark"] input::placeholder { color: #a3b7c6; }
html[data-theme="dark"] .dataset-abstract-visual { background: #253a4a; }
html[data-theme="dark"] .dataset-umap-frame { border-color: #496579; }
html[data-theme="dark"] .dataset-umap-legend { border-color: #496579; background: rgb(20 36 50 / 93%); }
html[data-theme="dark"] .dataset-umap-legend span { color: #e4eef5; }
html[data-theme="dark"] .dataset-preview-table tr:nth-child(even) td,
html[data-theme="dark"] .marker-table tr:nth-child(even) td { background: #22394a; }
html[data-theme="dark"] .about-member-photo { border-color: #476174; background: #243b4d; }
html[data-theme="dark"] .home-hub-list-item,
html[data-theme="dark"] .home-hub-list-heading,
html[data-theme="dark"] .dataset-panel-heading,
html[data-theme="dark"] .dataset-results-toolbar { border-color: #3b5263; }
html[data-theme="dark"] .home-featured-visual { background: #253b4e; }
html[data-theme="dark"] .home-hub-footer { color: #a4bbcc; }
html[data-theme="dark"] .compliance-link { color: #adbfcd; }
html[data-theme="dark"] :is(
  .dataset-catalog-copy h3, .dataset-catalog-meta dd,
  .dataset-information-panel > h3, .dataset-content-list dd
) { color: #e7f1f8; }
html[data-theme="dark"] :is(
  .dataset-catalog-copy p, .dataset-catalog-meta dt,
  .dataset-content-list dt, .marker-cell-secondary
) { color: #b5c8d6; }
html[data-theme="dark"] .home-explore-copy strong,
html[data-theme="dark"] .home-hot-categories > strong,
html[data-theme="dark"] .home-hub-section-heading small { color: #e4eef6; }
html[data-theme="dark"] .home-explore-icon { background: #29495d; color: #d7ecf8; }
html[data-theme="dark"] .home-hot-categories span { background: #274355; color: #d7e8f3; }

/* Dark mode: the semantic --marker-navy token is already lightened above;
   these are hard-coded navy/literal dark text and icon surfaces that the
   token swap cannot reach, plus the two solid fills that reuse --marker-navy
   as a background (skip link, pagination active) which must stay distinct. */
html[data-theme="dark"] .skip-link { background: #1b3040; color: #e2edf5; }
html[data-theme="dark"] .home-featured-code { color: #9fb8c9; }
html[data-theme="dark"] .home-explore-icon svg { color: #8fd4f2; }
html[data-theme="dark"] .home-explore-copy strong b { color: #7fc4e8; }
html[data-theme="dark"] .home-hub-list-item > span { color: #7fc4e8; }
html[data-theme="dark"] .home-hub-list-heading > span { background: #3a2a20; color: #f5a46b; }
html[data-theme="dark"] .home-hub-side-top .home-hub-list:first-child .home-hub-list-item:first-child { background: #3a2a20; }
html[data-theme="dark"] .home-hub-side-top .home-hub-list:first-child .home-hub-list-item:first-child > span { color: #f5a46b; }
html[data-theme="dark"] .home-demo-chip { background: #263f51; color: #cfe3f0; }

html[data-theme="dark"] .dataset-context-summary { color: #a9c1d2; }
html[data-theme="dark"] .dataset-breadcrumb a,
html[data-theme="dark"] .dataset-overview-link,
html[data-theme="dark"] .dataset-source-panel a { color: #7cc9ec; }
html[data-theme="dark"] .dataset-overview-link:hover,
html[data-theme="dark"] .dataset-overview-link:focus-visible { color: #a5dcf7; }
html[data-theme="dark"] .dataset-catalog-kicker { color: #a9c1d2; }
html[data-theme="dark"] .dataset-organ-option:disabled { opacity: 1; color: #a6bdcc; }
html[data-theme="dark"] .dataset-organ-option:disabled b { background: #22394a; color: #a6bdcc; }
html[data-theme="dark"] .dataset-demo-badge { color: #98501e; }
html[data-theme="dark"] .dataset-description-copy,
html[data-theme="dark"] .dataset-source-panel p { color: #b9ccd9; }
html[data-theme="dark"] .dataset-stat-grid span { color: #c3d6e4; }
html[data-theme="dark"] .dataset-publication-source > span { color: #a9c1d2; }
html[data-theme="dark"] .dataset-publication-source > strong { color: #7cc9ec; }
html[data-theme="dark"] .dataset-click-count { color: #9fb8c9; }
html[data-theme="dark"] .dataset-section-heading svg { stroke: #7cc9ec; }
html[data-theme="dark"] .dataset-abstract-label { color: #a9c1d2; }
html[data-theme="dark"] .dataset-abstract-panel figcaption strong { color: #dcecf6; }
html[data-theme="dark"] .dataset-primary-action:not(.disabled) { border-color: #087d9d; background: #087d9d; color: #fff; }
html[data-theme="dark"] .dataset-primary-action:not(.disabled):is(:hover, :focus-visible) { border-color: #0b7595; background: #0b7595; }
html[data-theme="dark"] .dataset-download-panel button { border-color: #0d75b8; background: #0d75b8; }

html[data-theme="dark"] .marker-scroll-hint { color: #a9c1d2; }
html[data-theme="dark"] .marker-reference-label { color: #7cc9ec; }
html[data-theme="dark"] .marker-pill-list .marker-pill-more { color: #4f6275; }
html[data-theme="dark"] .marker-pagination-bar .page-link:not(:disabled) { border-color: #496579; color: #c3d6e4; }
html[data-theme="dark"] .marker-pagination-bar .page-link:disabled { border-color: #496579; background: #22394a; color: #9cb4c4; }
html[data-theme="dark"] .marker-pagination-bar .page-item.active .page-link { border-color: #496579; background: #263f51; color: #dcebf5; }
html[data-theme="dark"] .marker-table thead th { background: #263f51; color: #eaf3f9; }
html[data-theme="dark"] .marker-note-kicker,
html[data-theme="dark"] .marker-detail-kicker { color: #7fc4e8; }
html[data-theme="dark"] .marker-detail-header { background: #162a3a; border-color: #3b5263; }
html[data-theme="dark"] .marker-detail-drawer { border-left-color: #3b5263; }
html[data-theme="dark"] .marker-filter-actions .btn-link { color: #7cc9ec; }
html[data-theme="dark"] .marker-filter-actions .btn-link:hover { color: #a5dcf7; }
html[data-theme="dark"] :is(.marker-download-button, .marker-detail-button) { border-color: #087d9d; background: #087d9d; color: #fff; }
html[data-theme="dark"] :is(.marker-download-button, .marker-detail-button):is(:hover, :focus-visible) { border-color: #0b7595; background: #0b7595; }
html[data-theme="dark"] .marker-detail-body h3 { color: #e7f1f8; }
html[data-theme="dark"] .marker-detail-definition dt { color: #a9c1d2; }
html[data-theme="dark"] .marker-detail-definition dd { color: #e2edf5; }
html[data-theme="dark"] .marker-copy-button { border-color: #496579; color: #cfe3f0; }
html[data-theme="dark"] .marker-copy-button:hover { border-color: #7cc9ec; color: #7cc9ec; }
html[data-theme="dark"] .marker-reference-list { color: #b5c8d6; }

/* The light marker-table hover selector sets a literal pale fill on individual
   cells. Override it after the striped-row rule so hover and keyboard focus
   retain the dark data-console surface without changing light-mode behavior. */
html[data-theme="dark"] .marker-workspace .marker-table tbody tr:is(:hover, :focus-within) td {
  background: #294657;
}

html[data-theme="dark"] .marker-workspace .marker-table tbody tr:active td {
  background: #314f61;
}

html[data-theme="dark"] .about-member-role { color: #7fc4e8; }
html[data-theme="dark"] .about-member-email a { color: #7cc9ec; }

.home-explore-copy strong { white-space: normal; text-overflow: clip; }

@media (max-width: 1250px) {
  .portal-header-search { display: none; }
}

@media (min-width: 768px) and (max-width: 1050px) {
  .portal-navbar .navbar-collapse { margin-left: 12px; }
  .portal-navbar .marker-nav-links .nav-link { padding-inline: .5rem; }
}

@media (max-width: 767px) {
  .portal-navbar { min-height: 64px; }
  .portal-navbar .navbar-collapse { margin-left: 0; }
  .portal-nav-shell { width: calc(100% - 20px); gap: 4px; }
  .portal-navbar .marker-brand { gap: 5px; }
  .portal-navbar .marker-brand-logo { width: 33px; }
  .portal-navbar .navbar-collapse { width: 100%; }
  .portal-navbar .marker-nav-links .nav-link { border-bottom: 0; }
  .portal-theme-toggle { width: 34px; height: 34px; margin-left: auto !important; }
  .portal-language-switch { min-height: 34px; margin-left: 0 !important; padding-inline: 6px; font-size: .72rem; }
  .portal-navbar .navbar-toggler { margin-left: 0 !important; padding: 4px 6px; }
  .portal-navbar .navbar-toggler-icon { width: 22px; height: 22px; }
  .home-category-drawer { top: auto; bottom: 18px; height: 44px; }
  .home-category-drawer-panel { top: auto; bottom: 0; }
  .home-category-drawer-toggle,
  .home-category-drawer-handle { top: 0; transform: none; }
}

/* ---- About group/team cards: restrained micro-emphasis (light + dark) ----
   Same gentle language as the homepage showcase cards: a tiny lift, deepened
   shadow and tinted border. Cards are content, not links, so no pointer
   cursor is added; hover is gated to fine pointers for touch. */
.about-overview,
.about-member {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

@media (hover: hover) and (pointer: fine) {
  .about-overview:hover,
  .about-member:hover {
    transform: translateY(-2px);
    border-color: #c0cdd9;
    box-shadow: 0 10px 22px rgb(8 43 76 / 12%);
  }

  html[data-theme="dark"] .about-overview:hover,
  html[data-theme="dark"] .about-member:hover {
    border-color: #4d6b80;
    box-shadow: 0 10px 22px rgb(0 0 0 / 28%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .about-overview,
  .about-member { transition: none; }
  .about-overview:hover,
  .about-member:hover { transform: none; }
}
