:root {
  --ink: #241b31;
  --text: #463e50;
  --muted: #665d70;
  --blue: #59367e;
  --teal: #256a62;
  --paper: #faf8fc;
  --line: #e1dbe8;
  --violet-light: #f1ebf7;
  --plum: #2b1e38;
  --rose: #f6bbd1;
  font-family: "Source Sans 3", "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 15px;
}

a:hover { color: #41245f; }
:is(button, a, input, select, textarea, summary, canvas):focus-visible {
  outline: 3px solid #8855ba;
  outline-offset: 3px;
}
.site-header { height: 76px; }
.header-inner { max-width: 1500px; padding-inline: clamp(18px, 3vw, 44px); gap: 26px; }
.brand { font-size: 19px; font-weight: 700; letter-spacing: -.025em; gap: 11px; }
.brand strong { display: inline; font: inherit; letter-spacing: inherit; }
.brand-mark {
  display: grid;
  place-items: center;
  height: 38px;
  width: 38px;
  border-radius: 50%;
  background: var(--plum);
  color: #fff;
  font: 600 24px/1 Georgia, serif;
  letter-spacing: 0;
}
.site-header nav { gap: clamp(13px, 1.8vw, 26px); }
.site-header nav a, .header-extra > a { font-size: 13px; color: var(--text); }
.site-header nav a.active, .header-extra a.active { color: var(--blue); font-weight: 700; }
.site-header nav small { background: var(--violet-light); }
.header-extra > a:first-child { display: inline-flex; }
main { max-width: 1440px; padding-inline: clamp(18px, 4vw, 58px); }
.inner-page, .atlas-v2.cell-atlas-page, #expression.expression-page { padding-top: clamp(28px, 4vw, 54px); }
.page-heading, .atlas-v2 .cell-heading {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.page-heading h1, .atlas-v2 .cell-heading h1 {
  font-size: clamp(29px, 3.4vw, 46px);
  font-weight: 720;
  letter-spacing: -.035em;
  line-height: 1.17;
}
.page-heading p, .atlas-v2 .cell-heading p { font-size: 14px; color: var(--muted); }
.eyebrow { letter-spacing: .05em; font-size: 11px; }
.page-heading .eyebrow, .cell-heading .eyebrow, .atlas-comparison-heading .eyebrow,
.atlas-section-heading .eyebrow, .expression-panel > .eyebrow { display: none; }
.button, .atlas-v2 .button.primary { min-height: 42px; font-size: 13px; border-radius: 8px; }
.button:hover, .atlas-v2 .button.primary:hover { background: #41245f; }
.button.secondary { color: var(--blue); border-color: #d5c9e3; background: #fff; }
.button.secondary:hover { color: #41245f; background: var(--violet-light); }
.atlas-v2 .button.primary { background: var(--blue); border-color: var(--blue); }
.panel, .filter-panel, .dataset-card, .table-wrap, .spatial-card, dialog { border-color: var(--line); }
.panel { border-radius: 12px; }
.table-wrap th, .cc-scroll th { background: #f4eff8; color: #453551; }
.table-wrap th, .table-wrap td, .cc-scroll th, .cc-scroll td { font-variant-numeric: tabular-nums; }
.table-wrap tbody tr:hover { background: #fcf9ff; }
.study-link, .text-button, .panel summary { color: var(--blue); }
.search, .filter-panel select { background: #fdfbfe; border-color: var(--line); }
.search input { font-size: 14px; }
.search input::placeholder { color: var(--muted); }
.filter-panel label, .subline, .study-title, .data-footnote, .atlas-v2 .atlas-small { color: var(--muted); }
.tag, .status-chip, .chip, .selected-pill { background: var(--violet-light); color: #573a70; border-color: #e0d5eb; }
.inline-note, .catalog-note { background: #f5f0f9; border-color: var(--line); color: #51445f; }

/* Home */
.home-workspace {
  max-width: 740px;
  margin-inline: auto;
  padding-block: clamp(50px, 10vh, 104px) 34px;
}
.home-intro { text-align: center; }
.home-intro h1 {
  color: var(--ink);
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.1;
  letter-spacing: -.045em;
  font-weight: 730;
}
.home-intro p { color: var(--muted); font-size: clamp(14px, 2vw, 17px); margin-top: 10px; }
.home-overview {
  margin-top: clamp(28px, 6vw, 48px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.home-overview h2 { font-size: clamp(19px, 3vw, 24px); margin: 0 0 12px; }
.home-overview p { color: var(--text); font-size: 15px; line-height: 1.85; margin: 0; }
.home-overview p + p { margin-top: 12px; }
.home-overview h3 { font-size: 16px; margin: 20px 0 8px; }
.home-study-list { margin: 0; padding-inline-start: 1.3em; color: var(--text); line-height: 1.75; }
.home-study-list li + li { margin-top: 6px; }
.home-overview a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.catalog-tissues { margin: 0 0 16px; padding: 12px 16px; }
.catalog-tissues > summary { cursor: pointer; font-weight: 650; }
.catalog-tissues .tissue-grid { margin: 14px 0 0; }
.section-heading h2 { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.025em; }
.section-heading a { font-size: 13px; }
.tissue-card { min-width: 0; box-shadow: none; padding: 16px; }
.tissue-card:hover { transform: none; border-color: #ac90c2; box-shadow: none; }
.tissue-en, .tissue-count { color: var(--muted); }
.tissue-count strong { color: var(--blue); }
.tissue-illustration { display: block; width: 60px; height: 60px; margin-bottom: 14px; }
.spatial-art .tissue-illustration { width: 90px; height: 90px; margin: 0; }
.domain-grid { gap: 14px; margin-bottom: 32px; }
.domain-card, .fertility-card { background: var(--violet-light); color: var(--text); border-color: #e4d9ef; }
.domain-card.fertility-card { background: #eaf4ef; border-color: #d3e6dd; }
.domain-card::after { content: none; }
.domain-card h2, .domain-card .domain-bottom strong { color: var(--blue); }
.fertility-card h2, .fertility-card .domain-bottom strong { color: var(--teal); }
.domain-card p, .domain-bottom { font-size: 13px; }
.home-bottom { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
.module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; margin: 0; }
.module-card { padding: 13px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; color: var(--text); }
.module-card:hover { border-color: var(--blue); }
.module-card p { margin: 4px 0 0; min-height: 0; }
.featured-item { grid-template-columns: minmax(78px, auto) 1fr; }
.featured-item .study-link, .featured-item h3 { font-size: 13px; }
.site-footer { max-width: 1324px; padding-block: 24px 30px; color: var(--muted); }
.footer-brand, .footer-links a, .footer-version, .footer-brand span { color: var(--muted); }
.dataset-card .card-bottom { flex-wrap: wrap; }
.dataset-download { padding-inline: 11px; }
.dataset-files { padding-inline-start: 1.25em; overflow-wrap: anywhere; }
/* Shared single-cell controls and result views */
.sc-study-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 25%);
  gap: 8px 20px;
  align-items: end;
  padding: 17px 21px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.sc-study-bar label { display: grid; gap: 4px; font-weight: 650; color: var(--ink); min-width: 0; }
.sc-study-bar select { max-width: 100%; min-width: 0; min-height: 44px; text-overflow: ellipsis; }
.sc-study-source { align-self: end; margin-bottom: 11px; font-size: 13px; }
.sc-study-status { grid-column: 1 / -1; color: var(--muted); font-size: 12px; margin: 0; }
.sc-study-status:empty { display: none; }
.sc-view-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  margin: 0 0 24px;
  height: auto;
  white-space: normal;
}
.sc-view-nav .button.secondary {
  display: grid;
  justify-items: start;
  justify-content: stretch;
  gap: 2px;
  min-height: 82px;
  max-width: none;
  padding: 12px 19px;
  border: 1px solid #d5c9e3;
  border-radius: 12px;
  text-align: left;
}
.sc-view-nav .button::after { content: none; }
.sc-view-nav .button strong { font-size: clamp(16px, 1.7vw, 22px); }
.sc-view-nav .button small { background: transparent; color: var(--muted); padding: 0; font-size: 12px; font-weight: 450; }
.sc-view-nav .button.secondary[aria-current="page"] { background: var(--plum); border-color: var(--plum); }
.sc-view-nav .button[aria-current="page"] small { color: #eee4f1; }
.atlas-v2 .atlas-layout { gap: 18px; }
.atlas-v2 .atlas-settings { background: var(--violet-light); border-color: var(--line); }
.atlas-v2 .atlas-settings-title { color: #4f326a; }
.atlas-v2 .atlas-workspace, .atlas-v2 .atlas-de-panel { min-width: 0; border-color: var(--line); }
.atlas-v2 .atlas-cohort-stats > *, .expression-dataset-note { background: #f6f1f9; border-color: var(--line); }
.atlas-v2 .atlas-facet-plot { border-color: var(--line); }
.atlas-v2 .cell-legend { font-size: 13px; }
.communication { margin-top: 0; }
.communication .cc-title { font-size: clamp(23px, 2.8vw, 31px); margin: 0; }
.cc-intro { display: flex; justify-content: space-between; gap: 12px 22px; align-items: start; flex-wrap: wrap; }
.cc-intro p { margin-top: 4px; color: var(--muted); }
.cc-note { background: #eef5f1; color: #35534a; border-color: #579084; }
.cc-panel { padding: clamp(14px, 2.2vw, 26px); }
.cc-filters select, .cc-filters input { min-height: 42px; font-size: 13px; }
.cc-network { border-block: 1px solid var(--line); padding: 10px 0; }
.cc-network-tools { display: flex; gap: 10px 22px; align-items: end; flex-wrap: wrap; }
.cc-network-tools label { display: grid; gap: 4px; font-size: 13px; }
.cc-network-tools output { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cc-network th:first-child { position: sticky; left: 0; z-index: 1; }
.cc-network button { color: #251836; font-weight: 650; }
.cc-network button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #523472; }
.cc-filters { margin-top: 13px; }
.expression-panel, .sw-controls, .sw-card { border-color: var(--line); }
.expression-tabs button[aria-pressed="true"], .sw-stages button.active {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--violet-light);
}
.expression-group-chart, .sw-stats > div { background: #f8f4fa; border-color: var(--line); }
.sw-stats strong { color: var(--ink); }
.sw-stats span, .sw-note, .sw-status, .sw-controls label, .sw-gene-form label { color: var(--muted); }
.sw-table-wrap th { background: #f4eff8; color: #453551; }
.integration-live { background: #fbf8fd; }
.integration-live > summary { color: var(--blue); font-weight: 650; cursor: pointer; }
.integration-live[open] > summary { margin-bottom: 14px; }
.integration-live .integration-live-counts a { background: var(--violet-light); }

@media (max-width: 990px) {
  .header-inner { gap: 16px; }
  .site-header nav { gap: 13px; }
  .site-header nav a { font-size: 12px; }
  .brand { font-size: 17px; }
  .site-footer { margin-inline: clamp(18px, 4vw, 58px); }
}
@media (max-width: 800px) {
  .site-header { height: auto; }
  .header-inner { display: block; padding-top: 12px; }
  .site-header nav { overflow-x: auto; height: 48px; margin-top: 8px; }
  .site-header nav a { padding: 0; }
  .header-extra { display: none; }
  .sc-study-bar { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .sc-study-source { margin-bottom: 0; }
}
@media (max-width: 600px) {
  .site-header nav { flex-wrap: wrap; gap: 0 15px; height: auto; overflow: visible; }
  .site-header nav a { min-height: 34px; }
  .home-bottom { grid-template-columns: minmax(0, 1fr); }
  .section-heading { gap: 10px; }
  .site-footer { display: grid; }
  .sc-study-bar { padding: 12px; }
  .sc-view-nav { gap: 8px; }
  .sc-view-nav .button.secondary { min-height: 74px; padding: 8px 10px; white-space: normal; }
  .sc-view-nav .button small { font-size: 11px; }
}
@media (max-width: 385px) {
  .tissue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The analysis navigation stays visible on desktop and opens on demand on mobile. */
body {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: 100vh;
  grid-template-rows: 1fr auto;
}
.site-header {
  grid-row: 1 / 3;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  border: 0;
  background: #2b1e38;
  color: #f5eef8;
}
.header-inner { display: block; height: auto; padding: 24px 13px; }
.site-header .brand { color: white; margin: 0 8px 26px; }
.site-header .brand-mark { background: #ead9f2; color: #352244; }
.sidebar-toggle { display: none; }
.site-header #site-navigation { display: block; height: auto; overflow: visible; margin: 0; white-space: normal; }
.site-header #site-navigation a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px 12px;
  border-radius: 6px;
  color: #f5eef8;
  font-size: 14px;
  line-height: 1.4;
}
.site-header #site-navigation a:hover { background: #3c2d4a; }
.site-header #site-navigation a.active { color: #fff; background: #564067; }
.site-header #site-navigation a.active::after { content: none; }
.sidebar-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 7px 12px;
  border-radius: 6px;
  color: #f5eef8;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}
.sidebar-group > summary::-webkit-details-marker { display: none; }
.sidebar-group > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.sidebar-group[open] > summary::after { transform: rotate(225deg); }
.sidebar-group > summary:hover, .sidebar-group.has-current > summary { background: #3c2d4a; }
.sidebar-group > summary:focus-visible { outline: 2px solid #ead9f2; outline-offset: -2px; }
.sidebar-submenu {
  list-style: none;
  padding: 0 0 0 9px;
  margin: 4px 0 6px 16px;
  border-left: 1px solid #775f85;
}
.sc-comparison { margin: 0 0 14px; padding: 14px 16px; }
.sc-comparison-fields { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.sc-comparison-fields label { display: grid; gap: 4px; min-width: min(100%, 145px); }
.sc-comparison-fields label > span { font-size: 13px; }
.sc-comparison-fields select { min-height: 40px; }
.sc-comparison .atlas-presets { margin: 10px 0 0; }
.sc-comparison .atlas-presets:empty { display: none; }
.sidebar-utilities { border-top: 1px solid #634f70; margin-top: 12px; padding-top: 10px; }
.sidebar-link { margin-bottom: 8px; }
body > main, body > .site-footer { grid-column: 2; width: 100%; min-width: 0; }
body > .site-footer { padding-inline: clamp(18px, 4vw, 58px); margin-inline: auto; }
.repository-panel > summary { cursor: pointer; color: var(--ink); font-weight: 650; }
.repository-panel li { overflow-wrap: anywhere; margin-block: 6px; }
.source-literature-search { max-width: 520px; }
#source-publications td:nth-child(2) a { white-space: nowrap; }
@media (max-width: 900px) {
  body { display: block; }
  .site-header { position: relative; height: auto; overflow: visible; }
  .header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; padding: 10px 16px; }
  .site-header .brand { margin: 0; }
  .sidebar-toggle {
    display: block;
    padding: 8px 12px;
    background: #ead9f2;
    color: #352244;
    border-radius: 6px;
    font-weight: 650;
  }
  .site-header #site-navigation { grid-column: 1 / -1; padding-top: 10px; }
  .sidebar-toggle[aria-expanded="false"] + #site-navigation { display: none; }
}
