:root {
  --ink: #07183d;
  --text: #16264d;
  --muted: #64728e;
  --line: #dce5f2;
  --soft-line: #edf2f8;
  --bg: #f7faff;
  --card: #ffffff;
  --blue: #0f62db;
  --blue-2: #2f7df0;
  --cyan: #0fa7bd;
  --green: #39a765;
  --orange: #f4a62a;
  --red: #e84d5b;
  --purple: #7c48d8;
  --pink: #d44aa2;
  --shadow: 0 12px 34px rgba(35, 61, 104, 0.08);
  --page-width: 1260px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-width: 1180px;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.site-header {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  width: var(--page-width);
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-icon {
  width: 38px;
  height: 38px;
}

.brand-icon path,
.brand-icon circle {
  stroke: var(--blue);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.brand-icon circle {
  fill: #fff;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.nav-btn {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--text);
  height: 68px;
  padding: 0 8px;
  border-radius: 0;
  font-size: 13px;
  white-space: nowrap;
}

.nav-btn.active {
  color: var(--blue);
  font-weight: 700;
}

.nav-btn.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 3px;
  background: var(--blue);
  border-radius: 4px 4px 0 0;
}

.header-search {
  width: 230px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding-left: 12px;
}

.header-search input,
.wide-search input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 11px 8px;
  color: var(--text);
}

.header-search button {
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
}

.header-search svg,
button svg {
  width: 20px;
  height: 20px;
  stroke: var(--blue);
  fill: none;
  stroke-width: 2.3;
  stroke-linecap: round;
}

.primary,
.secondary,
.link-button {
  border-radius: 7px;
  border: 1px solid var(--blue);
  padding: 11px 18px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.primary.compact {
  padding: 10px 16px;
}

.secondary,
.link-button {
  background: #fff;
  color: var(--blue);
}

.link-button {
  border: 0;
  padding: 0;
  font-weight: 600;
}

.full { width: 100%; }

main {
  width: var(--page-width);
  margin: 0 auto;
  padding: 24px 32px 18px;
}

.view { display: none; }
.view.active { display: block; }

h1 {
  margin: 0 0 16px;
  font-size: 42px;
  line-height: 1.12;
  color: var(--ink);
  letter-spacing: 0;
}

h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 16px;
}

h3 span {
  color: var(--muted);
  font-weight: 500;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.hero-grid {
  display: grid;
  grid-template-columns: 430px 740px;
  gap: 24px;
  align-items: center;
  justify-content: start;
  margin: 8px 16px 24px;
}

.hero-copy {
  padding: 12px 0 0 2px;
}

.hero-copy p {
  max-width: 430px;
  font-size: 17px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 24px;
}

.hero-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  width: 740px;
  height: 390px;
  min-width: 740px;
  min-height: 390px;
  max-width: 740px;
  max-height: 390px;
}

.hero-map {
  position: relative;
  padding: 0;
  border-right: 1px solid var(--line);
  width: 370px;
  height: 390px;
  min-height: 390px;
}

.hero-map canvas {
  width: 370px;
  height: 330px;
  display: block;
}

.hero-tracks {
  display: block;
  width: 370px;
  height: 390px;
  min-height: 390px;
}

.hero-tracks > div {
  height: 100%;
  padding: 0;
  border-bottom: 0;
}

.hero-tracks canvas {
  width: 370px;
  height: 330px;
  display: block;
}

.hero-plot-title {
  height: 60px;
  margin: 0;
  padding: 18px 22px 8px;
  font-size: 21px;
  line-height: 1.15;
  color: var(--ink);
}

.visual-title {
  position: absolute;
  left: -9999px;
  top: -9999px;
  display: grid;
  gap: 2px;
  z-index: 2;
}

.visual-title span {
  color: var(--muted);
  font-size: 12px;
}

.scale-bar {
  position: absolute;
  left: -9999px;
  bottom: auto;
  color: var(--ink);
  font-size: 12px;
}

.scale-bar span {
  display: block;
  width: 46px;
  border-top: 3px solid var(--ink);
  margin-bottom: 3px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}

.metric {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.metric .metric-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #eef5ff;
  color: var(--blue);
  flex: 0 0 auto;
}

.metric svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric b {
  display: block;
  font-size: 20px;
  color: var(--metric-color, var(--blue));
  line-height: 1;
  overflow-wrap: anywhere;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.metric-species { --metric-color: #6f42c1; }
.metric-studies { --metric-color: #0f62db; }
.metric-samples { --metric-color: #0fa7bd; }
.metric-spots { --metric-color: #2e7d32; }
.metric-apa { --metric-color: #8b5cf6; }
.metric-splice { --metric-color: #1565c0; }
.metric-iso { --metric-color: #0f9b9b; }
.metric-platforms { --metric-color: #2f7d42; }

.metric-species .metric-icon { background: #f3eeff; color: #6f42c1; }
.metric-studies .metric-icon { background: #eef5ff; color: #0f62db; }
.metric-samples .metric-icon { background: #eaf9fb; color: #0fa7bd; }
.metric-spots .metric-icon { background: #eef8ee; color: #2e7d32; }
.metric-apa .metric-icon { background: #f4efff; color: #8b5cf6; }
.metric-splice .metric-icon { background: #edf5ff; color: #1565c0; }
.metric-iso .metric-icon { background: #e9f9f8; color: #0f9b9b; }
.metric-platforms .metric-icon { background: #edf8ef; color: #2f7d42; }

.section-title,
.section-heading {
  margin: 14px 2px 12px;
}

.section-title {
  text-align: center;
  font-size: 22px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.module-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.module-grid.four {
  grid-template-columns: repeat(4, 1fr);
}

.module-grid.six {
  grid-template-columns: repeat(6, 1fr);
}

.module-grid.five {
  grid-template-columns: repeat(5, 1fr);
}

.layer-card,
.analysis-card,
.event-type-card {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.layer-card {
  min-height: 140px;
}

.layer-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
}

.layer-icon path,
.layer-icon circle,
.analysis-card svg path,
.analysis-card svg circle {
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.layer-card ul {
  margin: 8px 0 0 18px;
  padding: 0;
  color: var(--text);
  line-height: 1.6;
  font-size: 13px;
}

.event-type-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}

.event-type-card {
  min-height: 258px;
  text-align: center;
  padding: 20px 14px 12px;
}

.event-type-card b {
  display: block;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  margin-bottom: 8px;
}

.event-type-card span {
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
  min-height: 38px;
  display: block;
}

.event-svg,
.gene-cartoon,
.track-svg,
.preview-gene,
.sankey-svg {
  width: 100%;
  height: 100%;
}

.hero-tracks b {
  display: block;
  color: var(--ink);
  font-size: 18px;
  margin-bottom: 8px;
}

.event-svg {
  height: 165px;
  margin-top: 10px;
}

.analysis-card {
  min-height: 170px;
  padding: 14px;
}

.analysis-visual {
  height: 92px;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  margin-bottom: 10px;
  background: #fbfdff;
  overflow: hidden;
}

.analysis-card p {
  font-size: 13px;
  line-height: 1.45;
}

.page-title-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 18px;
}

.page-title-row h1 {
  font-size: 36px;
  margin-bottom: 8px;
}

.quick-insights {
  width: 484px;
  min-width: 484px;
  padding: 12px 16px;
  overflow: hidden;
}

.wide-search {
  display: flex;
  gap: 12px;
  padding: 12px;
  margin-bottom: 16px;
}

.browser-layout,
.spatial-layout {
  display: grid;
  gap: 20px;
}

.browser-layout {
  grid-template-columns: 260px 1fr;
  align-items: start;
}

.spatial-layout {
  grid-template-columns: 260px 780px 300px;
}

.spatial-linked-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.spatial-linked-panels .card {
  padding: 18px;
}

.spatial-linked-panels .linked-controls-card {
  grid-column: 1 / -1;
}

.inline-query {
  box-shadow: none;
  border: 0;
  padding: 0;
  margin: 4px 0 0;
}

.spatial-linked-panels .specificity-query {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.spatial-linked-panels .specificity-query button {
  grid-column: 1 / -1;
}

.spatial-linked-panels .linked-controls-card .specificity-query {
  grid-template-columns: 1.25fr 1.35fr .95fr 1fr auto;
}

.spatial-linked-panels .linked-controls-card .specificity-query button {
  grid-column: auto;
}

.spatial-linked-panels .compact-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.spatial-linked-panels .compact-summary .mini-card {
  border-radius: 8px;
  box-shadow: none;
  padding: 10px;
}

.spatial-linked-panels .compact-summary b {
  font-size: 18px;
}

.annotation-callout {
  background: #f5f9ff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  margin: -4px 0 12px;
  padding: 10px 12px;
}

.spatial-linked-panels h4 {
  color: var(--ink);
  font-size: 13px;
  margin: 8px 0 8px;
}

.cell-layout {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  gap: 14px;
  max-width: 100%;
  overflow: hidden;
}

.cell-layout > *,
.cell-main,
.cell-plot-grid > *,
.cell-lower-grid > *,
.cell-linked-panels > * {
  min-width: 0;
}

.cell-plot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 100%;
  overflow: hidden;
}

.cell-plot-grid .plot-card {
  min-width: 0;
  overflow: hidden;
}

.cell-plot-grid canvas {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  aspect-ratio: 620 / 430;
  height: auto;
}

.cell-main {
  display: grid;
  gap: 14px;
}

.cell-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
  align-items: start;
  max-width: 100%;
  overflow: hidden;
}

.cell-detail-grid > .card {
  padding: 16px 18px;
}

.cell-linked-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 10px;
  max-width: 100%;
  overflow: hidden;
  align-items: start;
}

.cell-linked-panels .linked-controls-card {
  grid-column: 1 / -1;
}

.cell-analysis-query {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 1.8fr) auto;
}

.cell-event-row {
  cursor: pointer;
}

.cell-event-row:hover {
  background: #eef6ff;
}

.cell-event-row.selected {
  background: #e8f1ff;
  box-shadow: inset 3px 0 0 var(--purple);
}

.cell-analysis-row {
  cursor: pointer;
}

.cell-analysis-row:hover {
  background: #eef6ff;
}

.cell-analysis-row.selected {
  background: #e8f1ff;
  box-shadow: inset 3px 0 0 var(--purple);
}

#cell .detail div {
  min-width: 0;
}

#cell .detail b,
#cell .detail span,
#cell td,
#cell th {
  overflow-wrap: anywhere;
}

#cellDetail {
  margin-bottom: 0;
}

#cellDetail div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

#cellDetail span:first-child {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#cellDetail b {
  text-align: left;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.compact-table {
  max-height: 240px;
}

.selected-sj-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.selected-sj-summary-grid .mini-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
}

.selected-sj-summary-grid .mini-card b {
  display: block;
  color: var(--blue);
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.selected-sj-summary-grid .mini-card span {
  color: var(--muted);
  font-size: 12px;
}

.filter-panel {
  padding: 16px;
  align-self: start;
}

.filter-panel label,
.query-strip label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
}

select,
input {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

select {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkbox-grid {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
}

.mini-metric-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.browser-main .mini-metric {
  min-width: 0;
}

.browser-main .mini-metric b,
.browser-main .mini-metric span {
  overflow-wrap: anywhere;
}

.mini-metric {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-metric b {
  display: block;
  font-size: 22px;
  color: var(--blue);
}

.mini-metric span {
  color: var(--muted);
  font-size: 12px;
}

.table-header {
  display: flex;
  justify-content: space-between;
  padding: 16px 18px 0;
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
}

#cellSpecificEventTable table {
  min-width: 640px;
}

#cell .annotation-panel {
  height: 100%;
}

#cellGeneModel {
  display: block;
  height: 420px;
  margin: 8px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

#cell .cell-linked-panels .card {
  padding: 16px;
}

#cell .cell-linked-panels .annotation-callout {
  margin: 0 0 10px;
  padding: 10px 12px;
}

#cellFeatureSummary {
  display: grid;
  gap: 0;
}

#cell .compact-summary {
  margin: 10px 0;
}

#cell .compact-summary .mini-card {
  padding: 10px 12px;
}

#cellSpecificEventTable table {
  table-layout: fixed;
}

#cellSpecificEventTable th {
  white-space: normal;
  font-size: 12px;
  line-height: 1.25;
  vertical-align: bottom;
}

#cellSpecificEventTable td {
  font-size: 12px;
}

#compareTable table {
  min-width: 980px;
}

#eventTable {
  min-height: 430px;
}

#eventTable table {
  min-width: 1280px;
  table-layout: fixed;
}

#eventTable th,
#eventTable td {
  font-size: 12.5px;
}

#eventTable th {
  vertical-align: bottom;
}

#eventTable td.truncate-cell > span,
#eventTable th.truncate-cell .sort-header-label {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: 13px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pager-btn {
  padding: 7px 12px;
  font-size: 13px;
}

.pager-btn:disabled {
  border-color: var(--line);
  color: var(--muted);
  background: #f5f8fc;
  cursor: not-allowed;
  opacity: 0.7;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid var(--soft-line);
  padding: 11px 12px;
  white-space: nowrap;
  text-align: left;
}

td.truncate-cell,
th.truncate-cell {
  max-width: 0;
}

td.truncate-cell > span {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

th {
  background: #f8fbff;
  color: var(--ink);
  font-weight: 800;
}

.sort-header {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  justify-content: space-between;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  line-height: 1.2;
}

.sort-header:hover,
.sort-header.active {
  color: var(--blue);
}

.sort-header-label {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.sort-indicator {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 10px;
  opacity: 0.8;
}

td:first-child,
td:nth-child(2) {
  color: var(--blue);
  font-weight: 700;
}

.event-row {
  cursor: pointer;
}

.event-row:hover {
  background: #eef6ff;
}

.event-row.selected {
  background: #e8f1ff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.selected-strip {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(330px, 420px) minmax(380px, 1fr);
  gap: 18px;
  margin-top: 16px;
  padding: 18px;
  align-items: stretch;
}

.selected-strip > * {
  min-width: 0;
}

.preview-plot h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.preview-plot canvas,
.preview-plot svg {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfdff;
}

.preview-grid {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.preview-grid div,
.detail div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--soft-line);
}

.preview-grid span:first-child,
.detail span:first-child {
  color: var(--muted);
}

.preview-grid div span:last-child,
.detail div span:last-child {
  text-align: right;
  overflow-wrap: anywhere;
}

.quad-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.plot-card {
  padding: 18px;
}

.plot-card h3,
.bottom-grid h3,
.annotation-panel h3 {
  font-size: 18px;
  line-height: 1.25;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
}

.chart-loading-scope {
  position: relative;
}

.chart-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  pointer-events: none;
  backdrop-filter: blur(2px);
}

.chart-loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #d9e6f7;
  border-top-color: var(--blue);
  border-radius: 999px;
  animation: chart-spin 0.8s linear infinite;
}

@keyframes chart-spin {
  to {
    transform: rotate(360deg);
  }
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.bottom-grid .card,
.specificity-grid .card,
.function-grid .card,
.compare-grid .card,
.download-grid .card {
  padding: 16px;
}

.annotation-panel {
  padding: 18px;
  align-self: start;
}

#cellGeneModel {
  display: block;
  height: 420px;
  margin: 8px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid currentColor;
}

.badge.green { color: var(--green); background: #eef9f2; }
.badge.purple { color: var(--purple); background: #f4efff; }

.detail {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}

.current-selection {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.action-bar {
  display: flex;
  gap: 10px;
}

.query-strip {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1fr auto;
  gap: 16px;
  padding: 16px;
  margin-bottom: 18px;
  align-items: end;
}

.query-strip input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 9px;
  color: var(--text);
  background: #fff;
}

.query-strip.specificity-query {
  grid-template-columns: 1.25fr 1.35fr .95fr 1fr auto;
}

.specificity-summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.specificity-summary-row .mini-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.specificity-summary-row b {
  color: var(--blue);
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.specificity-summary-row span {
  color: var(--muted);
  font-size: 12px;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.legend-row.compact {
  margin-top: 10px;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.dot.purple { background: var(--purple); }
.dot.blue { background: var(--blue-2); }
.dot.green { background: var(--green); }
.dot.orange { background: var(--orange); }

.specificity-grid,
.function-grid,
.compare-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.compare-query-card {
  margin-bottom: 16px;
  padding: 16px;
}

.compare-query {
  grid-template-columns: 1.05fr 1.05fr 1.4fr 1.45fr auto;
  margin-bottom: 0;
  padding: 0;
}

.compare-summary-row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 16px;
}

.compare-summary-row .mini-card b {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.compare-locus-card,
.compare-track-card {
  padding: 18px;
}

.compare-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.compare-card-head h3 {
  margin: 0;
}

.compare-zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compare-zoom-controls .secondary.compact {
  min-width: 42px;
}

.compare-zoom-label {
  min-width: 44px;
  text-align: center;
  color: var(--ink);
  font-weight: 700;
}

.compare-zoom-hint {
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.compare-gene-svg {
  height: 360px;
}

.compare-track-scroll {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.compare-track-svg {
  min-height: 320px;
  height: auto;
  display: block;
  width: 100%;
}

.table-span {
  grid-column: 1 / -1;
}

@media (max-width: 1120px) {
  .compare-query {
    grid-template-columns: 1fr 1fr;
  }

  .compare-summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compare-card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .download-example-grid {
    grid-template-columns: 1fr;
  }
}

.download-grid {
  display: grid;
  grid-template-columns: 260px 260px 1fr;
  gap: 16px;
}

.download-example-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.download-example-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
  padding: 14px 16px;
}

.download-example-card b {
  display: block;
  color: var(--ink);
  font-size: 15px;
  margin-bottom: 6px;
}

.download-example-card p {
  font-size: 13px;
  line-height: 1.55;
}

.download-example-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.download-example-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.download-example-link:hover {
  text-decoration: underline;
}

.download-card {
  text-align: center;
}

.download-card svg {
  width: 92px;
  height: 72px;
  margin: 8px auto 10px;
  stroke: var(--blue);
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.download-note {
  margin-top: 16px;
  padding: 14px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  line-height: 1.6;
  font-size: 13px;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) 1.1fr;
  gap: 16px;
}

.contact-card {
  padding: 24px;
}

.contact-card h3 {
  margin-top: 0;
}

.contact-person {
  padding: 16px 0;
  border-top: 1px solid var(--soft-line);
}

.contact-person:first-of-type {
  border-top: 0;
  padding-top: 6px;
}

.contact-person strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.contact-person sup,
.affiliation-card sup {
  color: var(--blue);
  font-weight: 800;
}

.contact-person a {
  display: inline-block;
  margin-top: 8px;
  color: var(--blue);
  text-decoration: none;
}

.contact-person a:hover {
  text-decoration: underline;
}

.affiliation-card p {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.8;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 18px 34px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.site-footer b {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.site-footer span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
}

svg .exon { fill: var(--blue); stroke: var(--blue); }
svg .utr { fill: #9bc0f9; stroke: #9bc0f9; }
svg .iso { fill: var(--cyan); stroke: var(--cyan); }
svg .pas1 { fill: var(--red); stroke: var(--red); }
svg .pas2 { fill: var(--purple); stroke: var(--purple); }
svg .intron,
svg .splice,
svg .axis {
  fill: none;
  stroke: #7890bd;
  stroke-width: 2;
}
svg text {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  fill: var(--text);
}
