:root {
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-axis: 18px;
  --axis-ink: #222;
  --ink: #122d2a;
  --ink-soft: #46635f;
  --paper: #f7f8f3;
  --white: #ffffff;
  --teal-900: #075e5a;
  --teal-700: #087f78;
  --teal-500: #13a59a;
  --teal-200: #aee2db;
  --teal-100: #dff2ee;
  --teal-050: #eef8f5;
  --sand: #e9e5d8;
  --gray-100: #eef1ee;
  --gray-300: #c7cfcb;
  --gray-500: #7a8d89;
  --orange: #ee8b55;
  --blue: #4b87cf;
  --violet: #8866c6;
  --rose: #d86e89;
  --gold: #d7aa37;
  --shadow: 0 18px 55px rgba(12, 52, 47, .1);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 11px;
  --sans: Arial, sans-serif;
  --display: Arial, sans-serif;
  --brand: "DIN Alternate", "DIN Condensed", "Avenir Next Condensed", "Arial Narrow", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--white);
  color: var(--teal-900);
}

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1500px, calc(100% - 72px));
  margin: 0 auto;
  padding: 28px 0;
}
.wordmark, .compact-brand {
  font-family: var(--display);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.015em;
}
.wordmark span, .compact-brand span {
  color: var(--teal-700);
}
.main-nav { display: flex; align-items: center; gap: clamp(16px, 2.2vw, 34px); }
.main-nav a {
  position: relative;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.main-nav a::after, .explore-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -5px;
  height: 1px;
  background: var(--teal-700);
  transition: right .2s ease;
}
.main-nav a:hover::after, .main-nav a:focus-visible::after,
.explore-nav a:hover::after, .explore-nav a:focus-visible::after { right: 0; }

.home-view {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  padding: 132px 30px 55px;
  background:
    radial-gradient(circle at 87% 9%, rgba(156, 221, 211, .32), transparent 31%),
    radial-gradient(circle at 10% 88%, rgba(255, 255, 255, .85), transparent 28%),
    linear-gradient(160deg, #f7f8f3 45%, #ecf5f1 100%);
}
.home-view::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  left: -270px;
  top: 20%;
  border: 1px solid rgba(9, 126, 119, .1);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(9, 126, 119, .025), 0 0 0 140px rgba(9, 126, 119, .018);
}
.home-view[data-shape="square"]::before { border-radius: 0; }
.home-view[data-shape="diamond"]::before { border-radius: 0; transform: rotate(45deg); }
.home-view[data-shape="triangle"]::before {
  width: 582px;
  height: 582px;
  left: -302px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cpath d='M0 300 600 0V600Z M135 300 460 135V465Z' fill='%23097e77' fill-opacity='.018' fill-rule='evenodd'/%3E%3Cpath d='M70 300 530 70V530Z M135 300 460 135V465Z' fill='%23097e77' fill-opacity='.025' fill-rule='evenodd'/%3E%3Cpath d='M135 300 460 135V465Z' fill='none' stroke='%23097e77' stroke-opacity='.10' stroke-width='1'/%3E%3C/svg%3E") center / contain no-repeat;
}
.hero-copy { position: relative; z-index: 2; max-width: 980px; margin-top: -25px; text-align: center; }
.hero-title-lockup { position: relative; display: inline-block; max-width: 100%; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-700);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(52px, 7vw, 102px);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: .98;
}
.hero-copy h1 em {
  color: var(--teal-700);
  font: inherit;
  font-style: normal;
}
.atlas-word { position: relative; display: inline-block; font: inherit; white-space: nowrap; }
.hero-intro {
  max-width: 625px;
  margin: 24px auto 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
}
.glycan-animation {
  position: absolute;
  top: 50%;
  left: calc(100% - 28px);
  width: clamp(105px, 12vw, 184px);
  aspect-ratio: 1;
  opacity: .94;
  filter: drop-shadow(0 15px 18px rgba(17, 78, 70, .08));
  transform: translateY(-82%);
}
.glycan-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; animation: glycan-cycle 20s infinite; }
.frame-1 { animation-delay: 0s; }
.frame-2 { animation-delay: 4s; }
.frame-3 { animation-delay: 8s; }
.frame-4 { animation-delay: 12s; }
.frame-5 { animation-delay: 16s; }
@keyframes glycan-cycle {
  0%, 18% { opacity: 1; transform: translateY(0) scale(1); }
  20%, 100% { opacity: 0; transform: translateY(4px) scale(.985); }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .glycan-frame { animation: none; }
  .glycan-frame:first-child { opacity: 1; }
}

.hero-search-shell { position: relative; z-index: 6; width: min(710px, 90vw); margin-top: -18px; }
.protein-search { position: relative; display: flex; align-items: center; }
.hero-search {
  min-height: 74px;
  padding: 8px 9px 8px 26px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 22px;
  background: linear-gradient(135deg, var(--teal-700), #0d9489);
  box-shadow: 0 20px 44px rgba(6, 103, 96, .22);
}
.protein-search > svg { flex: 0 0 auto; width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }
.hero-search > svg { color: rgba(255, 255, 255, .8); }
.protein-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; }
.hero-search input { padding: 10px 17px; color: white; font-size: 16px; }
.hero-search input::placeholder { color: rgba(255, 255, 255, .72); }
.hero-search button {
  align-self: stretch;
  min-width: 118px;
  border: 0;
  border-radius: 15px;
  background: var(--white);
  color: var(--teal-900);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.favorite-row { display: flex; justify-content: center; gap: 8px; align-items: center; margin-top: 14px; color: var(--gray-500); font-size: var(--text-xs); }
.favorite-row button { border: 0; border-bottom: 1px solid rgba(7, 94, 90, .3); padding: 2px 1px; background: none; color: var(--teal-900); cursor: pointer; font-size: var(--text-xs); }
.search-results {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(430px, 58vh);
  overflow-y: auto;
  border: 1px solid rgba(13, 85, 78, .1);
  border-radius: 16px;
  background: rgba(255, 255, 255, .985);
  box-shadow: var(--shadow);
  color: var(--ink);
}
.search-result {
  display: grid;
  grid-template-columns: minmax(84px, auto) 1fr auto;
  gap: 13px;
  align-items: center;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--gray-100);
  padding: 12px 15px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover, .search-result:focus-visible { outline: 0; background: var(--teal-050); }
.search-result strong { color: var(--teal-900); font-size: 13px; }
.search-result span { overflow: hidden; color: var(--ink-soft); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
.search-result small { color: var(--gray-500); font-size: var(--text-xs); text-align: right; }
.search-empty { margin: 0; padding: 18px; color: var(--gray-500); font-size: 12px; text-align: center; }
.explore-view { min-height: 100vh; padding: 84px clamp(20px, 3vw, 50px) 42px; background: var(--paper); }
.explore-topbar {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 170px minmax(280px, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 64px;
  padding: 8px clamp(20px, 3vw, 50px);
  border-bottom: 1px solid rgba(11, 86, 78, .09);
  background: rgba(247, 248, 243, .92);
  backdrop-filter: blur(18px);
}
.compact-brand { color: var(--teal-900); }
.compact-search { width: 100%; max-width: 560px; height: 42px; padding: 0 15px; border-radius: 12px; background: var(--teal-700); color: white; }
.compact-search input { padding: 10px 12px; color: white; font-size: 12px; }
.compact-search input::placeholder { color: rgba(255, 255, 255, .72); }
.explore-top-actions { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 18px; }
.explore-nav { display: flex; align-items: center; gap: clamp(16px, 2.2vw, 34px); }
.explore-nav a { position: relative; color: var(--ink-soft); font-size: var(--text-xs); font-weight: 600; text-decoration: none; white-space: nowrap; }
.explore-nav a[aria-current="page"] { color: var(--ink-soft); }
.method-pill {
  justify-self: end;
  border: 1px solid var(--teal-200);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--teal-700);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.loading-state { display: grid; place-items: center; min-height: calc(100vh - 160px); color: var(--gray-500); font-size: 12px; }
.loader { width: 26px; height: 26px; border: 2px solid var(--teal-100); border-top-color: var(--teal-700); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.protein-dashboard { width: min(1600px, 100%); margin: 0 auto; }
.protein-heading { display: flex; justify-content: space-between; gap: 28px; align-items: end; padding: 3px 2px 10px; }
.protein-heading h2 { margin: 0; font-family: var(--display); font-size: clamp(34px, 3.5vw, 50px); font-weight: 700; letter-spacing: -.025em; line-height: 1; }
.protein-heading h2 small { margin-left: 9px; color: var(--teal-700); font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: .04em; vertical-align: middle; }
.protein-heading > div > p:last-child { max-width: 650px; margin: 5px 0 0; color: var(--ink-soft); font-size: var(--text-xs); }
.protein-counts { display: flex; gap: 8px; }
.protein-heading-side { display: flex; max-width: 760px; flex-direction: column; align-items: flex-end; gap: 5px; }
.protein-counts div { min-width: 84px; border-left: 1px solid var(--teal-200); padding-left: 11px; }
.protein-counts strong, .protein-counts span { display: block; }
.protein-counts strong { font-size: 18px; }
.protein-counts span { color: var(--gray-500); font-size: var(--text-xs); letter-spacing: .05em; text-transform: uppercase; }
.protein-class-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 10px; }
.protein-map { margin-bottom: 8px; border: 1px solid rgba(12, 96, 88, .11); border-radius: var(--radius-md); padding: 11px 14px 9px; background: rgba(255,255,255,.72); }
.section-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.section-label-row h3, .panel h3, .annotation-panel h3 { margin: 0; font-size: 13px; font-weight: 700; }
.section-label-row > p { margin: 0; color: var(--gray-500); font-size: 12px; line-height: 1.35; }
.overlay-heading { align-items: end; }
.overlay-heading h3 { font-size: 16px; }
.segment-scroll { margin-top: 6px; overflow-x: auto; border: 1px solid var(--gray-100); border-radius: 11px; background: white; }
.segment-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; margin-top: 8px; }
.proteomics-only-links { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 10px; color: var(--ink-soft); font-size: 13px; }
.proteomics-only-links[hidden] { display: none; }
.segment-notes { margin-left: auto; text-align: right; }
.segment-notes .segment-note { margin: 0; text-align: right; }
.proteomics-only-links button { border: 1px solid var(--teal-200); border-radius: 999px; padding: 4px 9px; background: white; color: var(--teal-700); font: inherit; cursor: pointer; }
.proteomics-only-links button:hover, .proteomics-only-links button:focus-visible { background: var(--teal-100); }
.proteomics-only-links button[aria-current="true"] { background: var(--teal-100); }
.protein-abundance-panel { scroll-margin-top: 84px; }
.segment-canvas { padding: 8px 12px 9px; }
.segment-summary { display: flex; justify-content: space-between; gap: 20px; margin: 0 0 4px; color: var(--gray-500); font-size: 12px; }
.segment-summary strong { color: var(--ink); font-size: 14px; }
.segment-axis-row, .segment-profile-guide-row, .segment-organ-row { display: grid; grid-template-columns: 72px minmax(720px, 1fr) 44px; align-items: center; }
.segment-axis-row { height: 58px; color: var(--gray-500); font-size: var(--text-xs); }
.segment-axis-start { align-self: end; justify-self: end; padding: 0 8px 8px 0; }
.segment-axis-end { align-self: end; padding: 0 0 8px 8px; }
.segment-space { position: relative; height: 100%; }
.protein-line { position: absolute; right: 0; bottom: 10px; left: 0; height: 3px; border-radius: 3px; background: var(--ink); }
.segment-position-marker { position: absolute; bottom: 6px; width: 10px; height: 10px; border: 2px solid white; border-radius: 50%; padding: 0; background: var(--ink); cursor: pointer; transform: translateX(-50%); }
.segment-position-marker.low { background: var(--gray-500); }
.segment-profile-guide-row { height: 49px; }
.segment-profile-guide { position: relative; height: 100%; }
.segment-profile-guide svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.segment-profile-guide path { fill: none; stroke: var(--teal-500); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.profile-site-label { position: absolute; bottom: 11px; border: 0; padding: 0 2px; background: white; color: var(--ink-soft); cursor: pointer; font-size: 12px; font-weight: 700; line-height: 1.2; transform: translateX(-50%); }
.profile-site-label.low { color: var(--gray-500); }
.profile-site-label:hover, .profile-site-label:focus-visible { color: var(--teal-700); outline: 0; text-decoration: underline; }
.segment-organ-rows { display: grid; gap: 6px; }
.segment-organ-row { height: 33px; }
.segment-organ-row > strong { padding-right: 10px; font-size: 12px; text-align: right; text-transform: capitalize; }
.composition-tile { position: absolute; top: 2px; display: flex; width: 64px; height: 28px; overflow: visible; border: 1px solid rgba(18,45,42,.26); border-radius: 2px; padding: 0; background: var(--gray-100); cursor: pointer; transform: translateX(-50%); }
.composition-tile i { display: block; height: 100%; }
.composition-tile i:first-child { border-radius: 1px 0 0 1px; }
.composition-tile i:last-child { border-radius: 0 1px 1px 0; }
.composition-tile:hover, .composition-tile.selected { z-index: 4; border-color: var(--teal-700); }
.composition-tile:focus-visible { z-index: 5; outline: 2px solid var(--teal-900); outline-offset: 2px; }
.composition-tile.uncovered { border-color: var(--gray-300); background: #f1f3f2; cursor: default; }
.composition-tile.no-composition { border-style: dashed; background: repeating-linear-gradient(135deg, #eef1ef 0 5px, #fafbfa 5px 10px); }
.composition-tile.low { border-color: var(--gray-500); }
.composition-tile.low::before { content: "*"; position: absolute; z-index: 5; top: -9px; right: -6px; color: var(--ink); font-size: 12px; font-weight: 700; line-height: 1; text-shadow: 0 0 2px white; }
.segment-note { margin: 5px 0 0; color: var(--gray-500); font-size: 12px; line-height: 1.45; text-align: center; }
.site-empty { display: flex; min-height: 110px; align-items: center; justify-content: center; padding: 22px; color: var(--gray-500); font-size: 12px; text-align: center; }
.site-analysis { border: 1px solid rgba(8, 94, 88, .11); border-radius: var(--radius-md); padding: 11px; background: rgba(255,255,255,.75); }
.analysis-toolbar { display: flex; justify-content: space-between; gap: 14px; align-items: end; }
.analysis-title h3 { margin: 0; font-size: 24px; }
.analysis-controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: end; justify-content: flex-end; }
.analysis-controls label, .control-label { display: grid; gap: 4px; color: var(--gray-500); font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.analysis-controls select { min-width: 122px; height: 36px; border: 1px solid var(--gray-300); border-radius: 7px; padding: 0 25px 0 8px; background: white; color: var(--ink); font-size: 13px; text-transform: none; }
.analysis-controls select:disabled { color: var(--gray-500); }
.site-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; margin-top: 7px; overflow: hidden; border: 1px solid var(--gray-100); border-radius: 8px; background: var(--gray-100); }
.site-metrics > div { min-height: 58px; padding: 10px 11px; background: white; }
.site-metrics span, .site-metrics strong { display: block; }
.site-metrics span { color: var(--gray-500); font-size: var(--text-xs); letter-spacing: .03em; }
.site-metrics strong { margin-top: 5px; overflow: hidden; font-size: 14px; line-height: 1.2; text-overflow: ellipsis; }
.proteomics-only-note { grid-column: 1 / -1; margin: 0; padding: 13px 15px; background: white; color: var(--ink-soft); font-size: 12px; }
.analysis-main-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(330px, .75fr); gap: 8px; margin-top: 7px; }
.scientific-plot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.scientific-panel { min-width: 0; border: 1px solid var(--gray-100); border-radius: 10px; padding: 8px 8px 7px; background: white; }
.scientific-panel-heading { text-align: center; }
.scientific-panel-heading h4 { margin: 0; font-family: var(--display); font-size: 18px; }
.scientific-panel-heading h4 span { color: var(--gray-500); font-size: 12px; }
.scientific-panel-heading p { margin: 4px 0 0; color: var(--gray-500); font-size: 13px; line-height: 1.35; }
.scientific-chart { aspect-ratio: 2 / 1; margin-top: 3px; }
.scientific-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.scientific-chart text { fill: var(--gray-500); font-family: var(--sans); font-size: 14px; }
.scientific-chart .axis-label { fill: var(--ink-soft); font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.scientific-chart .axis { stroke: #9baaa6; stroke-width: 1; }
.scientific-chart .gridline { stroke: #e3e8e5; stroke-width: 1; }
.pairwise-detail-panel { min-width: 0; max-height: 270px; overflow: auto; border: 1px solid var(--gray-100); border-radius: 10px; padding: 9px; background: white; }
.pairwise-intro { margin: 5px 0 12px; color: var(--gray-500); font-size: 12px; line-height: 1.5; }
.pairwise-controls { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.pairwise-controls label { display: grid; gap: 4px; color: var(--gray-500); font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pairwise-controls select { min-width: 0; height: 36px; border: 1px solid var(--gray-300); border-radius: 7px; padding: 0 22px 0 7px; background: white; color: var(--ink); font-size: 12px; }
.comparison-bars { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 9px; }
.comparison-profile > strong { display: block; margin-bottom: 6px; font-size: 12px; }
.composition-bar { display: flex; height: 13px; overflow: hidden; border-radius: 3px; background: var(--gray-100); }
.composition-bar i { display: block; height: 100%; }
.comparison-profile p { margin: 5px 0 0; color: var(--gray-500); font-size: var(--text-xs); line-height: 1.45; }
.comparison-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin-top: 8px; }
.comparison-metrics > div { min-height: 50px; border: 1px solid var(--gray-100); border-radius: 6px; padding: 8px; }
.comparison-metrics span, .comparison-metrics strong { display: block; }
.comparison-metrics span { color: var(--gray-500); font-size: var(--text-xs); text-transform: capitalize; }
.comparison-metrics strong { margin-top: 4px; font-size: 12px; line-height: 1.2; }
.comparison-table-wrap { margin-top: 8px; overflow-x: auto; }
.comparison-table-wrap table { width: 100%; border-collapse: collapse; font-size: var(--text-xs); }
.comparison-table-wrap th, .comparison-table-wrap td { border-bottom: 1px solid var(--gray-100); padding: 6px 7px; text-align: right; white-space: nowrap; }
.comparison-table-wrap th:first-child { text-align: left; }
.comparison-table-wrap thead th { background: var(--teal-050); color: var(--ink-soft); text-transform: capitalize; }
.support-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
.panel { min-width: 0; border: 1px solid rgba(8, 94, 88, .1); border-radius: var(--radius-md); padding: 14px; background: rgba(255,255,255,.86); }
.panel-header { display: flex; min-height: 39px; justify-content: space-between; gap: 10px; align-items: start; }
.panel-header .eyebrow { margin-bottom: 4px; }
.confidence-note { margin: 4px 0 0; color: var(--gray-500); font-size: 12px; }
.confidence-note.low { color: #697470; }
.control-stack { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.segmented-control { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--teal-050); }
.segmented-control.quiet { background: var(--gray-100); }
.segmented-control button { border: 0; border-radius: 6px; padding: 7px 10px; background: transparent; color: var(--gray-500); font-size: var(--text-xs); font-weight: 700; cursor: pointer; }
.segmented-control button.active { background: var(--white); color: var(--teal-900); box-shadow: 0 1px 5px rgba(19, 75, 69, .1); }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 10px; min-height: 15px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-soft); font-size: var(--text-xs); }
.legend-swatch { width: 9px; height: 9px; border-radius: 2px; }
.hover-hint { color: var(--gray-500); font-size: 12px; }
.exact-grid { max-height: 520px; margin-top: 12px; padding: 3px 0; overflow: auto; }
.exact-row { display: grid; min-height: 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.exact-name { overflow: hidden; padding-right: 12px; color: var(--ink-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.exact-cell { height: 34px; border: 0; border-radius: 4px; background: var(--gray-100); cursor: help; }
.exact-header { color: var(--gray-500); font-size: 12px; text-align: center; }
.empty-note { display: grid; min-height: 120px; place-items: center; margin: 0; padding: 14px; color: var(--gray-500); font-size: 12px; line-height: 1.5; text-align: center; }
.annotation-panel { display: grid; grid-template-columns: 190px 1fr; gap: 30px; align-items: start; margin-top: 10px; border-radius: var(--radius-md); padding: 19px 22px; background: var(--teal-100); }
.annotation-panel p:last-child { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }

.content-page {
  min-height: 100svh;
  padding: 150px max(32px, calc((100% - 1200px) / 2)) 110px;
  background:
    radial-gradient(circle at 88% 4%, rgba(174, 226, 219, .34), transparent 25%),
    linear-gradient(180deg, var(--paper), var(--white) 45%);
}
#tvd.content-page {
  padding-top: 110px;
  background: linear-gradient(180deg, var(--paper), var(--white) 45%);
}
#contact.content-page, #raw-data.content-page { padding-top: 110px; }
#raw-data .page-grid { margin-top: 0; }
.page-hero { max-width: 850px; }
.narrow-page-hero { max-width: 720px; }
.page-hero h2 {
  max-width: 820px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(52px, 6vw, 82px);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: .98;
}
.page-lede { max-width: 710px; margin: 27px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.75; }
.page-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 70px; overflow: hidden; border: 1px solid var(--sand); border-radius: var(--radius-md); background: var(--sand); }
.page-stat-grid div { display: flex; min-height: 108px; flex-direction: column; justify-content: center; padding: 22px 28px; background: rgba(255, 255, 255, .9); }
.page-stat-grid strong { color: var(--teal-900); font-family: var(--display); font-size: 35px; font-weight: 700; }
.page-stat-grid span { margin-top: 5px; color: var(--gray-500); font-size: var(--text-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.page-grid { display: grid; gap: 18px; margin-top: 64px; }
.page-grid-three { grid-template-columns: repeat(3, 1fr); }
.page-grid-two { grid-template-columns: repeat(2, 1fr); }
.page-card { min-height: 250px; border: 1px solid var(--sand); border-radius: var(--radius-md); padding: 27px; background: rgba(255, 255, 255, .72); }
.page-card > span { color: var(--teal-700); font-size: var(--text-xs); font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.page-card h3, .page-callout h3, .contact-grid h3 { margin: 58px 0 12px; font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1.05; }
.page-card p, .method-notes p, .glossary-grid p, .publication-placeholder p { margin: 0; color: var(--ink-soft); font-size: var(--text-xs); line-height: 1.7; }
.page-callout { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-top: 18px; border-radius: var(--radius-md); padding: 33px 38px; background: var(--teal-100); }
.page-callout h3 { margin: 0; }
.page-callout a, .repository-link { flex: 0 0 auto; border-radius: 12px; padding: 13px 18px; background: var(--teal-900); color: white; font-size: var(--text-xs); font-weight: 700; text-decoration: none; }
.method-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; margin-top: 42px; border-top: 1px solid var(--sand); padding-top: 30px; }
.method-notes strong { font-size: var(--text-xs); }
.method-notes p { margin-top: 8px; }
.glossary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 64px; overflow: hidden; border: 1px solid var(--sand); border-radius: var(--radius-md); background: var(--sand); }
.glossary-grid article { min-height: 200px; padding: 28px; background: rgba(255, 255, 255, .94); }
.glossary-grid h3 { margin: 0 0 35px; font-family: var(--display); font-size: 27px; font-weight: 700; }
.publication-placeholder { display: grid; grid-template-columns: 170px 1fr; gap: 28px; align-items: start; max-width: 760px; margin-top: 70px; border-top: 1px solid var(--sand); padding-top: 28px; }
.publication-placeholder > span { color: var(--teal-700); font-size: var(--text-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.publication-placeholder strong { font-family: var(--display); font-size: 26px; font-weight: 700; }
.publication-placeholder p { margin-top: 8px; }
.repository-link { display: inline-block; margin-top: 25px; }
.repository-link span { margin-left: 6px; }
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; max-width: 1200px; margin-top: 0; }
.contact-grid article { min-height: 220px; border: 1px solid var(--sand); border-radius: var(--radius-md); padding: 30px; background: rgba(255, 255, 255, .82); }
.contact-grid h3 { margin: 54px 0 8px; }
.contact-grid a { color: var(--teal-700); font-size: 12px; font-weight: 700; }
footer { min-height: 88px; background: var(--ink); }
.tooltip { position: fixed; z-index: 100; max-width: 230px; pointer-events: none; border-radius: 8px; padding: 7px 9px; background: var(--ink); color: white; font-size: var(--text-xs); line-height: 1.45; box-shadow: 0 8px 30px rgba(0,0,0,.2); }

body.exploring > .site-header { display: none; }
body.exploring .content-page { display: none; }

@media (min-width: 1051px) {
  .explore-topbar { min-height: 72px; }
  .compact-brand { font-size: 17px; }
  .compact-search { height: 48px; }
  .compact-search input { font-size: 14px; }
  .explore-nav a { font-size: var(--text-xs); }

  .protein-heading { padding-bottom: 16px; }
  .protein-heading h2 { font-size: clamp(46px, 3.7vw, 58px); }
  .protein-heading h2 small { font-size: 15px; }
  .protein-heading > div > p:last-child { font-size: 13px; }
  .protein-counts { gap: 14px; }
  .protein-counts div { min-width: 104px; padding-left: 14px; }
  .protein-counts strong { font-size: 23px; }
  .protein-counts span { font-size: var(--text-xs); }
  .protein-class-legend { gap: 7px 13px; }

  .protein-map, .site-analysis { padding: 16px; }
  .section-label-row h3, .panel h3, .annotation-panel h3 { font-size: 18px; }
  .overlay-heading h3 { font-size: 21px; }
  .section-label-row > p { font-size: 12px; }
  .segment-scroll { margin-top: 10px; }
  .segment-canvas { padding: 12px 16px 13px; }
  .segment-summary { margin-bottom: 6px; font-size: 12px; }
  .segment-summary strong { font-size: 14px; }
  .segment-axis-row, .segment-profile-guide-row, .segment-organ-row { grid-template-columns: 88px minmax(720px, 1fr) 52px; }
  .segment-axis-row { height: 58px; font-size: var(--text-xs); }
  .segment-profile-guide-row { height: 49px; }
  .segment-position-marker { bottom: 7px; width: 12px; height: 12px; }
  .profile-site-label { bottom: 11px; font-size: 12px; }
  .segment-organ-rows { gap: 6px; }
  .segment-organ-row { height: 33px; }
  .segment-organ-row > strong { font-size: 12px; }
  .composition-tile { width: 64px; height: 28px; }
  .segment-note { margin-top: 6px; font-size: 12px; }

  .analysis-toolbar { gap: 20px; }
  .analysis-title h3 { font-size: 24px; }
  .confidence-note { font-size: 12px; }
  .analysis-controls { gap: 10px; }
  .analysis-controls label, .control-label { gap: 5px; font-size: var(--text-xs); }
  .analysis-controls select { min-width: 150px; height: 36px; padding-left: 10px; font-size: 13px; }
  .segmented-control { padding: 3px; }
  .segmented-control button { padding: 7px 10px; font-size: var(--text-xs); }
  .site-metrics { margin-top: 11px; }
  .site-metrics > div { min-height: 58px; padding: 10px 11px; }
  .site-metrics span { font-size: var(--text-xs); }
  .site-metrics strong { margin-top: 5px; font-size: 14px; }

  .analysis-main-grid { align-items: start; gap: 14px; margin-top: 12px; }
  .scientific-plot-grid { gap: 12px; }
  .scientific-panel { border-radius: 12px; padding: 13px 13px 11px; }
  .scientific-panel-heading h4 { font-size: 18px; }
  .scientific-panel-heading h4 span { font-size: 12px; }
  .scientific-panel-heading p { margin-top: 4px; font-size: 13px; }
  .scientific-chart { aspect-ratio: 1.55 / 1; margin-top: 7px; }
  .scientific-chart text { font-size: 14px; }
  .scientific-chart .axis-label { font-size: 13px; }
  .chart-legend { gap: 7px 13px; min-height: 20px; }
  .legend-item { gap: 5px; font-size: var(--text-xs); }
  .legend-swatch { width: 9px; height: 9px; }

  .pairwise-detail-panel { max-height: none; overflow: visible; border-radius: 12px; padding: 14px; }
  .pairwise-intro { margin: 5px 0 12px; font-size: 12px; }
  .pairwise-controls { gap: 10px; }
  .pairwise-controls label { gap: 5px; font-size: var(--text-xs); }
  .pairwise-controls select { height: 36px; font-size: 12px; }
  .comparison-bars { gap: 12px; margin-top: 12px; }
  .comparison-profile > strong { margin-bottom: 6px; font-size: 12px; }
  .composition-bar { height: 18px; border-radius: 4px; }
  .comparison-profile p { margin-top: 5px; font-size: var(--text-xs); }
  .comparison-metrics { gap: 6px; margin-top: 11px; }
  .comparison-metrics > div { min-height: 50px; padding: 8px; }
  .comparison-metrics span { font-size: var(--text-xs); }
  .comparison-metrics strong { margin-top: 4px; font-size: 12px; }
  .comparison-table-wrap { margin-top: 11px; }
  .comparison-table-wrap table { font-size: var(--text-xs); }
  .comparison-table-wrap th, .comparison-table-wrap td { padding: 6px 7px; }

  .support-grid { gap: 14px; margin-top: 16px; }
  .panel { padding: 20px; }
  .panel-header { min-height: 48px; }
  .hover-hint { font-size: 12px; }
  .exact-grid { max-height: 520px; margin-top: 12px; padding: 3px 0; }
  .exact-row { min-height: 36px; gap: 8px; margin-bottom: 8px; }
  .exact-name { padding-right: 12px; font-size: 13px; }
  .exact-cell { height: 34px; border-radius: 4px; }
  .exact-header { font-size: 12px; }
  .annotation-panel { margin-top: 16px; padding: 19px 22px; }
  .annotation-panel p:last-child { font-size: 12px; }
}

@media (max-width: 1050px) {
  .main-nav { gap: 15px; }
  .glycan-animation { left: calc(100% - 20px); width: 120px; opacity: .78; }
  .explore-topbar { grid-template-columns: 160px 1fr auto; }
  .explore-nav { display: none; }
  .site-metrics { grid-template-columns: repeat(3, 1fr); }
  .analysis-main-grid { grid-template-columns: 1fr; }
  .scientific-plot-grid { overflow-x: auto; padding-bottom: 4px; }
  .pairwise-detail-panel { max-height: none; }
  .page-grid-three, .glossary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .site-header { width: calc(100% - 34px); gap: 14px; padding-top: 20px; }
  .site-header > .wordmark { flex: 0 0 auto; }
  .main-nav { max-width: 52vw; justify-content: flex-start; gap: 14px; overflow-x: auto; padding: 5px 0 10px; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { display: block; flex: 0 0 auto; font-size: var(--text-xs); white-space: nowrap; }
  .home-view { display: flex; min-height: 100svh; flex-direction: column; justify-content: center; padding: 110px 18px 95px; }
  .hero-copy { margin: 0; }
  .hero-copy h1 { font-size: clamp(46px, 14vw, 66px); }
  .hero-intro { font-size: 13px; }
  .glycan-animation { top: 50%; left: calc(100% - 11px); width: 72px; opacity: .78; transform: translateY(-84%); }
  .hero-search-shell { width: 100%; margin-top: 44px; }
  .hero-search { min-height: 62px; padding-left: 17px; border-radius: 18px; }
  .hero-search input { padding: 8px 10px; font-size: 13px; }
  .hero-search button { min-width: 80px; border-radius: 12px; }
  .explore-view { padding: 82px 13px 40px; }
  .explore-topbar { grid-template-columns: 1fr; min-height: 68px; padding: 10px 13px; }
  .compact-brand { display: none; }
  .protein-heading { align-items: start; flex-direction: column; gap: 16px; }
  .protein-heading h2 { font-size: 42px; }
  .protein-heading-side { width: 100%; align-items: stretch; }
  .protein-class-legend { justify-content: flex-start; }
  .protein-counts { width: 100%; }
  .protein-counts div { flex: 1; min-width: 0; }
  .section-label-row > p { max-width: 170px; text-align: right; }
  .protein-map, .site-analysis { padding: 13px; }
  .overlay-heading, .analysis-toolbar { align-items: stretch; flex-direction: column; }
  .segment-summary { align-items: flex-start; flex-direction: column; gap: 3px; }
  .analysis-controls { justify-content: flex-start; }
  .analysis-controls label { flex: 1; }
  .analysis-controls select { width: 100%; min-width: 0; }
  .site-metrics { grid-template-columns: repeat(2, 1fr); }
  .analysis-main-grid, .scientific-plot-grid, .support-grid { grid-template-columns: 1fr; overflow: visible; }
  .scientific-chart { aspect-ratio: 1.55 / 1; min-height: 200px; }
  .panel-header { flex-direction: column; }
  .control-stack { justify-content: flex-start; }
  .annotation-panel { grid-template-columns: 1fr; gap: 9px; }
  .content-page { padding: 120px 18px 70px; }
  .page-hero h2 { font-size: clamp(45px, 14vw, 64px); }
  .page-lede { font-size: 13px; }
  .page-stat-grid { grid-template-columns: repeat(2, 1fr); margin-top: 48px; }
  .page-stat-grid div { min-height: 92px; padding: 18px; }
  .page-grid, .glossary-grid, .method-notes, .contact-grid { grid-template-columns: 1fr; }
  .page-grid { margin-top: 42px; }
  .page-card { min-height: 215px; padding: 23px; }
  .page-card h3 { margin-top: 42px; }
  .page-callout { align-items: flex-start; flex-direction: column; padding: 27px; }
  .glossary-grid { margin-top: 42px; }
  .glossary-grid article { min-height: 175px; padding: 24px; }
  .publication-placeholder { grid-template-columns: 1fr; gap: 12px; margin-top: 48px; }
  .contact-grid { margin-top: 48px; }
  footer { flex-direction: column; padding: 30px 24px; }
}

/* Readable scientific labels at every breakpoint. */
.legend-item { font-size: var(--text-base); gap: 7px; line-height: 1.35; }
.legend-swatch { width: 20px; height: 20px; flex: 0 0 20px; }
.protein-class-legend { gap: 8px 16px; }
.scientific-chart text { font-size: var(--text-axis); fill: var(--axis-ink); }
.scientific-chart .axis-label { font-size: var(--text-axis); fill: var(--axis-ink); }
.tooltip { font-size: 15px; }

/* Protein identity and one overlay heading; preserve room for the age plots. */
.protein-heading { align-items: center; padding-bottom: 10px; gap: 18px; }
.protein-heading h2 { font-size: 40px; }
.protein-heading-side { max-width: 76%; }
.protein-map { padding: 12px 14px; }
.segment-canvas { padding: 4px 12px 8px; }
.segment-axis-row { height: 28px; }

/* All leaders end at the label's center-top; ordered endpoints cannot cross. */
.segment-profile-guide svg { top: -11px; height: 49px; }
.profile-site-label { top: 14px; bottom: auto; font-size: 14px; }
.segment-position-marker, .segment-position-marker.low { background: #111; }
.segment-axis-start, .segment-axis-end { color: var(--axis-ink); font-size: var(--text-xs); }

.tooltip { max-width: min(380px, calc(100vw - 16px)); padding: 14px 16px; line-height: 1.45; overflow-wrap: anywhere; }
.tooltip-header { display: block; font-size: 16px; margin-bottom: 4px; }
.tooltip-psm { margin-bottom: 10px; }
.tooltip-class { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; margin-top: 7px; }

/* Four aligned modules, then comparison and exact composition. */
.scientific-plot-grid { display: grid; grid-template-columns: minmax(210px, .85fr) repeat(3, minmax(0, 1fr)); gap: 12px; overflow: visible; align-items: stretch; }
.site-statistics h3 { font-size: 20px; margin: 0 0 8px; }
.site-statistics h4 { font-size: 16px; margin: 0 0 6px; }
.site-statistics .confidence-note { font-size: 12px; line-height: 1.45; margin: 0 0 12px; }
.analysis-controls { display: grid; grid-template-columns: 1fr; justify-content: stretch; gap: 10px; }
.analysis-controls select { width: 100%; min-width: 0; }
.site-metrics { grid-template-columns: 1fr; margin-top: 12px; }
.site-metrics > div { min-height: 0; padding: 8px 10px; }
.site-metrics strong { overflow: visible; }
.support-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; margin-top: 12px; }
.pairwise-detail-panel, .exact-panel { min-width: 0; }
.scientific-panel-heading h4, .scientific-panel-heading h4 span { font-size: 18px; color: var(--ink); }
@media (max-width: 1000px) {
  .scientific-plot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .support-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .scientific-plot-grid { grid-template-columns: 1fr; }
  .protein-heading-side { max-width: 100%; }
}

/* SVG coordinates follow CSS pixels so text never shrinks with the viewBox. */
.scientific-chart { aspect-ratio: auto; min-height: 0; margin-top: 4px; }
.scientific-chart text, .scientific-chart .axis-label { font-size: var(--text-axis); fill: var(--axis-ink); }
.scientific-chart .age-tick { font-size: 14px; }
.scientific-panel-heading { min-height: 64px; }
.chart-legend { margin-top: 10px; }

/* A complete, compact nine-age matrix with its own scrolling region. */
.exact-grid { max-height: 420px; overflow: auto; padding: 0; margin-top: 10px; }
.exact-row { display: grid; grid-template-columns: minmax(112px, 1.8fr) repeat(9, minmax(26px, 1fr)); gap: 0; min-height: 14px; height: 14px; margin: 0; }
.exact-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12px/14px ui-monospace, monospace; padding-right: 5px; }
.exact-cell { min-width: 0; height: 14px; border: 0; border-radius: 0; padding: 0; font: 12px/14px var(--sans); }
.exact-cell.missing { background: repeating-linear-gradient(135deg, #f4f4f4 0 3px, #e5e5e5 3px 4px) !important; }
.exact-value { display: none; color: #687977; white-space: nowrap; }
.show-values .exact-value { display: inline; }
.exact-head { position: sticky; top: 0; z-index: 2; height: 26px; align-items: center; background: white; }
.exact-header { font-size: 12px; color: var(--axis-ink); }
.abundance-scale { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 12px; }
.abundance-scale i { width: 140px; height: 12px; background: linear-gradient(to right, rgba(8,127,120,.05), rgba(8,127,120,.95)); }
.exact-key { font-size: 12px; color: var(--ink-soft); line-height: 1.4; }
.exact-cell:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

/* Attach the glycan to the terminal n, with the search immediately below. */
.home-view { display: flex; flex-direction: column; justify-content: center; gap: 38px; padding-top: 150px; padding-bottom: 150px; }
.hero-copy { margin-top: 0; }
.glycoprotein-word { position: relative; display: inline-block; white-space: nowrap; margin-right: 0; }
.hero-copy h1 { letter-spacing: -.035em; }
.glycoprotein-word .glycan-animation { top: 0; left: auto; right: -.7em; width: 1.8125em; transform: translate(40%, -68%); }
.hero-search-shell { margin-top: 0; }
.hero-intro { margin: 0 auto 18px; text-align: center; font-size: 16px; }
@media (max-width: 720px) {
  .home-view { gap: 30px; padding: 140px 18px 100px; }
  .hero-copy h1 { font-size: clamp(40px, 11vw, 66px); line-height: 1.08; }
  .glycoprotein-word .glycan-animation { width: 1.625em; opacity: .94; }
  .hero-search-shell { margin-top: 0; }
}

.segment-canvas.no-sites .segment-profile-guide-row { display: none; }
.segment-canvas.no-sites .empty-note { min-height: 0; margin: 8px 0; padding: 12px; }

/* E330 explorer refinements. */
.main-nav a, .explore-nav a { font-size: 14px; }
.protein-class-legend > strong { white-space: nowrap; font-size: 14px; }
.segment-organ-row > strong { font-size: 16px; white-space: nowrap; }
.segment-axis-row, .segment-profile-guide-row, .segment-organ-row { grid-template-columns: 112px minmax(720px, 1fr) 52px; }
.segment-note { font-size: 13px; }
.site-metrics span { font-size: 13px; }
.site-metrics strong { font-size: 16px; line-height: 1.35; }
.scientific-panel-heading { min-height: 42px; }
.scientific-panel-heading h4 { line-height: 1.2; }
.scientific-chart .tick-mark { stroke: #697470; stroke-width: 1; }
.chart-panel { display: grid; grid-template-rows: 50px 170px auto; align-content: start; }
.chart-panel .scientific-panel-heading { min-height: 0; }
.chart-panel .plot-header-content { min-height: 0; }
.chart-panel .scientific-chart { margin-top: 0; }
@media (min-width: 800px) and (max-width: 1000px) {
  .scientific-plot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-statistics { grid-column: 1 / -1; }
  .site-statistics .analysis-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-statistics .site-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.chart-legend { min-height: 44px; margin: 8px 0 0; align-content: start; justify-content: center; }
.chart-legend .legend-item { font-size: 12px; }
.legend-line { position: relative; display: inline-block; width: 24px; height: 3px; flex: 0 0 24px; background: var(--legend-color); }
.legend-line::after { content: ""; position: absolute; left: 10px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--legend-color); }
.legend-line.combined { background: repeating-linear-gradient(90deg, #CD4D2C 0 5px, transparent 5px 8px); }
.legend-line.combined::after { background: linear-gradient(90deg, #CD4D2C 50%, #A34599 50%); }
.legend-note { color: var(--gray-500); font-size: 11px; }
.heterogeneity-controls { display: grid; gap: 4px; justify-content: center; margin-top: 6px; }
.heterogeneity-controls .segmented-control { justify-content: center; }
.heterogeneity-controls button { padding: 5px 6px; font-size: 11px; }
.comparison-distance { grid-column: 1 / -1; }
.distance-track { height: 8px; margin-top: 6px; border-radius: 8px; background: var(--gray-100); overflow: hidden; }
.distance-track i { display: block; height: 100%; background: #CD4D2C; }
.comparison-table-wrap .legend-swatch { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: middle; }
.exact-grid { max-height: 520px; }
.exact-age-heading { position: sticky; top: 0; z-index: 3; padding: 5px 0 3px 35%; border-bottom: 1px solid var(--gray-300); background: white; color: var(--ink-soft); font-size: 14px; font-weight: 700; text-align: center; }
.exact-row { grid-template-columns: minmax(158px, 2fr) repeat(var(--exact-columns, 9), minmax(38px, 1fr)); gap: 2px; min-height: 27px; height: 27px; margin-bottom: 2px; }
.exact-head { top: 25px; height: 30px; }
.exact-name { display: flex; align-items: center; min-width: 0; gap: 6px; padding-right: 4px; font: 14px/27px ui-monospace, monospace; }
.exact-name .legend-swatch { width: 12px; height: 12px; flex: 0 0 12px; }
.exact-cell { height: 27px; border-radius: 3px; font-size: 11px; }
.abundance-scale i { background: linear-gradient(to right, rgba(65,104,185,.07), rgba(65,104,185,.97)); }
.scientific-chart.cat-chart { display: block; }
.cat-easter-egg { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; width: 100%; height: 100%; margin: 0; text-align: center; }
.cat-easter-egg img { display: block; width: 100%; height: 100%; min-height: 0; border-radius: 12px; object-fit: cover; }
.cat-easter-egg figcaption { color: var(--ink-soft); font-size: 15px; }
.cat-support-photo { grid-template-rows: auto auto; height: auto; margin: 10px 0 0; }
.cat-support-photo img { height: auto; object-fit: contain; }
.tvd-controls { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin: 30px 0 16px; }
.tvd-controls label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.tvd-controls select, .tvd-controls input { min-width: 150px; height: 40px; border: 1px solid var(--gray-300); border-radius: 8px; padding: 0 10px; background: white; color: var(--ink); }
.tvd-zoom { display: flex; align-items: center; gap: 4px; height: 40px; }
.tvd-zoom span { margin-right: 5px; color: var(--ink-soft); font-size: 13px; }
.tvd-zoom button { height: 34px; border: 1px solid var(--gray-300); border-radius: 6px; background: white; cursor: pointer; }
.tvd-plot { overflow-x: auto; padding: 12px; border: 1px solid var(--gray-100); border-radius: 12px; background: white; }
.tvd-plot svg { display: block; min-width: 640px; width: 100%; }
.tvd-plot text { fill: var(--axis-ink); font: var(--text-axis) var(--sans); }
.tvd-plot .axis-label { font-weight: 400; }
.tvd-plot .axis, .tvd-plot .tick-mark { stroke: #697470; stroke-width: 1; }
.tvd-plot .tvd-threshold { stroke: #CD4D2C; stroke-dasharray: 4 5; opacity: .6; }
.tvd-plot circle { cursor: pointer; }
.tvd-plot circle.search-hit { stroke: #173A78; stroke-width: 1.5; }
.tvd-plot circle:hover, .tvd-plot circle:focus { stroke: var(--ink); stroke-width: 2; }
.tvd-count { margin: 4px 0; color: var(--ink-soft); font-size: 13px; }
.tooltip.tvd-tooltip { max-width: min(490px, calc(100vw - 16px)); }
.tooltip-tvd-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: baseline; margin-top: 7px; }
.tooltip-tvd-row strong { white-space: nowrap; }
@media (max-width: 1400px) {
  .explore-topbar { grid-template-columns: 170px minmax(0, 1fr); gap: 5px 14px; }
  .explore-top-actions { grid-column: 1 / -1; justify-content: flex-start; overflow-x: auto; }
  .explore-nav { display: flex; min-width: max-content; gap: 12px; }
  .explore-view { padding-top: 116px; }
  .main-nav { gap: 12px; }
}
@media (max-width: 1050px) {
  .main-nav { max-width: 72vw; overflow-x: auto; white-space: nowrap; }
}
@media (max-width: 720px) {
  .main-nav { flex-wrap: nowrap; justify-content: flex-start; }
  .explore-topbar { grid-template-columns: 1fr; }
  .explore-top-actions { grid-column: 1; }
  .explore-view { padding-top: 119px; }
  .tvd-controls { display: grid; }
}

/* E330 review: keep scientific controls and legends stable across proteins. */
.hero-intro { white-space: nowrap; }
.protein-heading-side { max-width: 80%; overflow-x: auto; }
.protein-class-legend { display: grid; grid-template-columns: max-content repeat(4, max-content); grid-auto-flow: row; align-items: center; justify-content: end; gap: 9px 16px; width: max-content; min-width: 100%; }
.protein-class-legend > strong { grid-row: 1 / 3; align-self: center; }
.protein-class-legend .legend-item { white-space: nowrap; font-size: 13px; }
.scientific-panel-heading h4, .site-statistics h3 { font-size: 18px; }
.site-statistics .confidence-note:empty { display: none; }
.site-metrics span { font-size: 15px; }
.chart-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; justify-content: stretch; gap: 5px 8px; min-height: 72px; margin: 8px 0 2px; }
.chart-legend .legend-item { align-items: center; font-size: 13px; }
.chart-legend .legend-note { grid-column: 1 / -1; font-size: 12px; }
.legend-line { width: 26px; height: 2px; flex: 0 0 26px; }
.legend-line::after { left: 9px; top: -4px; width: 10px; height: 10px; }
.legend-line.combined { background: repeating-linear-gradient(90deg, #CD4D2C 0 4px, #A34599 4px 8px); }
.heterogeneity-controls { justify-content: start; justify-items: start; margin: 5px 0 0; }
.heterogeneity-controls .segmented-control { justify-content: start; }
.heterogeneity-controls button { padding: 6px 8px; font-size: 12px; }
.scientific-chart .age-tick { font-size: 14px; }
.scientific-chart .axis { stroke: #697470; stroke-width: 1; }
.scientific-chart .tick-mark { stroke: #697470; stroke-width: 1; }
.pairwise-controls { display: grid; grid-template-columns: 1fr; gap: 12px; }
.pairwise-controls .pair-mode-label { max-width: 100%; }
.pairwise-controls .pair-selectors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pairwise-controls .pair-selectors:has([data-pair-site-a]) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pairwise-controls select { width: 100%; font-size: 14px; }
.comparison-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.comparison-column { min-width: 0; }
.comparison-profile > strong { display: block; min-height: 36px; font-size: 14px; line-height: 1.25; }
.comparison-site-metrics { display: grid; gap: 7px; margin-top: 10px; }
.comparison-metric { min-height: 52px; padding: 9px 10px; border: 1px solid var(--gray-100); border-radius: 7px; }
.comparison-metric span, .comparison-metric strong { display: block; }
.comparison-metric span { color: var(--gray-500); font-size: 13px; }
.comparison-metric strong { margin-top: 4px; font-size: 15px; line-height: 1.25; }
.comparison-distance { margin-top: 12px; }
.comparison-distance .comparison-metric { border-color: var(--gray-300); }
.scientific-plot-grid { align-items: start; }
.exact-panel .panel-header { display: block; min-height: 0; }
.exact-panel .hover-hint { display: block; margin-top: 4px; }
.exact-site-label { margin: 4px 0 0; color: var(--ink); font-size: 15px; font-weight: 700; }
.exact-grid { max-height: none; overflow: visible; }
.exact-age-heading { display: grid; grid-template-columns: minmax(148px, 2fr) repeat(var(--exact-columns, 9), minmax(38px, 1fr)); gap: 2px; padding: 5px 0 3px; border-bottom: 0; }
.exact-age-heading span { grid-column: 2 / -1; border-bottom: 1px solid var(--gray-300); text-align: center; }
.exact-row { grid-template-columns: minmax(148px, 2fr) repeat(var(--exact-columns, 9), minmax(38px, 1fr)); min-height: 34px; height: 34px; margin-bottom: 3px; }
.exact-name { font: 14px/34px ui-monospace, monospace; }
.exact-cell { height: 34px; font-size: 12px; }
.abundance-scale i { height: 15px; background: linear-gradient(to right, #0d0887, #7e03a8, #cc4778, #f89540, #f0f921); }
@media (max-width: 720px) {
  .hero-intro { white-space: normal; }
  .protein-heading-side { max-width: 100%; width: 100%; }
  .protein-class-legend { justify-content: start; }
  .pairwise-controls .pair-selectors, .pairwise-controls .pair-selectors:has([data-pair-site-a]) { grid-template-columns: 1fr; }
}
@media (max-width: 1200px) {
  .protein-heading { flex-wrap: wrap; }
  .protein-heading-side { width: 100%; max-width: 100%; }
  .protein-class-legend { min-width: 0; justify-content: start; }
}

/* Shared typography and stable atlas navigation. Keep existing text sizes or enlarge them. */
button, input, select, textarea, .exact-name { font-family: var(--display); }
.site-header {
  position: fixed;
  inset: 0 0 auto;
  width: 100%;
  min-height: 72px;
  margin: 0;
  padding: 8px clamp(20px, 3vw, 50px);
  border-bottom: 1px solid rgba(11, 86, 78, .09);
  background: rgba(247, 248, 243, .92);
  backdrop-filter: blur(18px);
}
.wordmark, .compact-brand { color: var(--ink); font-size: 17px; }
.wordmark span, .compact-brand span { color: var(--teal-700); }
@media (min-width: 721px) and (max-width: 1400px) {
  .compact-brand { transform: translateY(3.5px); }
}

/* Two four-item rows stay within the protein-heading height. JS chooses the largest fitting size. */
.protein-class-legend { column-gap: 12px; row-gap: 6px; }
.protein-class-legend > strong {
  display: flex;
  grid-row: 1 / 3;
  align-items: center;
  align-self: center;
  height: calc(100% - 10px);
  padding-right: 12px;
  border-right: 2px solid #111;
  font-size: calc(var(--legend-font-size, 13px) + 2px);
}
.protein-class-legend .legend-item { font-size: var(--legend-font-size, 13px); }
.segment-organ-row > strong { width: max-content; justify-self: end; text-align: right; }

/* Plot headers use less reserved space without changing the axes dimensions. */
.chart-panel { grid-template-rows: 50px 124px auto; }
.chart-legend { min-height: 0; }
.chart-legend .legend-item { font-size: 16px; }
.chart-legend:empty { display: none; }
.legend-line { width: 20px; height: 2px; flex-basis: 20px; }
.legend-line::after { left: 6px; top: -3px; width: 8px; height: 8px; }
.scientific-chart .axis-label { font-weight: 400; }
.analysis-controls .control-label { text-transform: none; }
.plot-summary-note { margin: 12px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.35; }
.protein-legend-entry { display: grid; justify-items: start; }
.protein-legend-entry .legend-item { position: relative; }
.protein-legend-entry .legend-note { margin-left: 26px; font-size: 12px; }
.low-replicate-star { position: relative; top: -2px; margin-left: 2px; font-size: 2em; line-height: .5; }
.heterogeneity-controls { width: 100%; gap: 6px; margin-top: 2px; }
.heterogeneity-control-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: center; gap: 5px; }
.heterogeneity-control-row > span { color: var(--ink-soft); font-size: 12px; line-height: 1.1; }
.heterogeneity-control-row .segmented-control { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.heterogeneity-control-row button { width: 100%; min-height: 37px; padding: 4px 2px; font-size: 12px; line-height: 1.1; }

/* Exact-composition controls and the same dark divider used in the top legend. */
.exact-site-controls { display: flex; gap: 8px; margin-top: 6px; }
.exact-site-controls select { min-width: 0; height: 36px; border: 1px solid var(--gray-300); border-radius: 7px; padding: 0 8px; background: white; color: var(--ink); font-size: 15px; }
.exact-site-controls select:first-child { flex: 2; }
.exact-site-controls select:last-child { flex: 1; }
.abundance-scale-wrap { display: grid; justify-items: end; gap: 3px; margin-top: 10px; }
.abundance-scale-label { color: var(--ink); font-size: 14px; font-weight: 700; }
.exact-name { border-right: 2px solid #111; }
.tooltip { white-space: pre-line; }
.distance-track i { background: #E5B84B; }

@media (max-width: 720px) {
  .compact-brand { display: block; }
  .explore-view { padding-top: 172px; }
}

/* Lamp1 review: preserve DIN only for the atlas name, and use Arial elsewhere. */
.wordmark, .compact-brand, .hero-copy h1 { font-family: var(--brand); }
.tooltip-warning { margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.3); }
.site-statistics h3 { white-space: nowrap; }
.site-statistics h3 [data-detail-site] { color: var(--teal-700); }
.scientific-plot-grid { grid-template-columns: minmax(326px, 1.02fr) repeat(3, minmax(0, 1fr)); }
.analysis-controls .site-selector-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.site-selector-row label { min-width: 0; }
.chart-panel .plot-header-content { transform: translateY(-12px); }
.chart-panel .chart-legend { margin-top: 0; row-gap: 3px; }
.chart-panel .chart-legend .legend-item { line-height: 1.05; }
.scientific-chart .age-tick, .scientific-chart .axis-label { font-size: var(--text-axis); }
.legend-mark { display: block; width: 28px; height: 12px; flex: 0 0 28px; overflow: visible; }
.protein-legend-entry { max-width: 100%; overflow: visible; }
.protein-legend-entry .legend-item { white-space: nowrap; }
.protein-legend-entry .legend-note { margin-left: 0; color: var(--ink-soft); font-size: 16px; white-space: nowrap; }
.low-replicate-star { position: static; display: inline-flex; align-items: center; margin-left: 3px; font-size: 2em; line-height: .5; transform: translateY(5px); }
.heterogeneity-control-row { grid-template-columns: 112px minmax(0, 1fr); }
.heterogeneity-control-row > span { color: var(--gray-500); font-family: var(--sans); font-size: 15px; font-weight: 700; letter-spacing: .03em; line-height: normal; }
.heterogeneity-control-row .segmented-control { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pairwise-controls { gap: 12px; }
.pairwise-controls .pairwise-top-row, .pairwise-controls .pair-selectors, .pairwise-controls .pair-selectors:has([data-pair-site-a]) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.exact-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-top: 8px; }
.exact-site-controls { display: flex; flex: 0 1 auto; gap: 8px; margin: 0; }
.exact-site-controls label { display: grid; min-width: 0; gap: 3px; color: var(--gray-500); font-size: var(--text-xs); font-weight: 700; }
.exact-site-controls label:first-child { width: 145px; }
.exact-site-controls label:last-child { width: 105px; }
.exact-site-controls select, .exact-site-controls select:first-child, .exact-site-controls select:last-child { width: 100%; height: 34px; font-size: 14px; }
.abundance-scale-wrap { flex: 0 0 auto; justify-items: center; margin: 0; }
.abundance-scale-label { width: 100%; text-align: center; }
.exact-name { border-right: 0; }
.exact-age-heading span { border-bottom: 2px solid #111; color: var(--axis-ink); font-size: var(--text-axis); font-weight: 400; }
.exact-head .exact-name, .exact-header { color: var(--axis-ink); font-family: var(--sans); font-size: var(--text-axis); font-weight: 400; }
@media (max-width: 1600px) {
  .chart-panel:has(.protein-legend-entry) { position: relative; }
  .protein-legend-entry .legend-note { position: absolute; top: 108px; left: 12px; z-index: 2; }
}
@media (max-width: 1000px) {
  .scientific-plot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-statistics { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .scientific-plot-grid { grid-template-columns: 1fr; }
  .exact-toolbar { flex-wrap: wrap; }
  .pairwise-controls .pairwise-top-row, .pairwise-controls .pair-selectors, .pairwise-controls .pair-selectors:has([data-pair-site-a]) { grid-template-columns: 1fr; }
}

.segment-axis-row, .segment-profile-guide-row, .segment-organ-row { grid-template-columns: 140px minmax(720px, 1fr) 52px; }
.analysis-controls .site-selector-row label,
.analysis-controls .control-label,
.heterogeneity-control-row > span,
.pairwise-controls label,
.exact-site-controls label,
.tvd-controls label,
.tvd-zoom span { color: var(--gray-500); font-family: var(--sans); font-size: 15px; font-weight: 700; letter-spacing: .03em; line-height: normal; text-transform: none; }
.age-control-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; }
.age-control-row .segmented-control { justify-self: start; }
.heterogeneity-controls { justify-items: stretch; }
.heterogeneity-control-row { width: 100%; min-width: 0; }
.heterogeneity-control-row button { height: 48px; min-height: 48px; }
.abundance-scale-label, .abundance-scale { color: var(--axis-ink); font-size: var(--text-axis); font-weight: 400; }
.abundance-scale-wrap { justify-items: center; }
.abundance-scale-label { width: max-content; white-space: nowrap; text-align: center; }
.abundance-scale { display: grid; grid-template-columns: 52px 140px 52px; align-items: center; gap: 8px; }
.abundance-scale span:first-child { text-align: right; }
.abundance-scale span:last-child { text-align: left; }
.abundance-scale i { width: 140px; }
.exact-age-heading span { position: relative; border-bottom: 0; color: var(--axis-ink); }
.exact-age-heading span::after { content: ""; position: absolute; top: calc(100% + 6px); left: 0; right: 0; height: 1px; background: var(--axis-ink); }
