/* ================================================================
   GPCompReports site.css
   Shared chrome + component tokens for all v2 pages.
   Layers on top of Primer Primitives (primitives.css + primitives-dark.css).
   No Materialize. System-font stack + Source Serif 4 for display.
   ================================================================ */

/* ----------- 1. Brand & semantic token overrides ----------- */

:root {
  --brand-primary: #0D9488;
  --brand-primary-hover: #0F766E;
  --brand-accent: #EA580C;
  --brand-accent-hover: #C2410C;

  --semantic-active: #1D4ED8;
  --semantic-active-soft: #DBEAFE;
  --semantic-inactive: #B91C1C;
  --semantic-inactive-soft: #FEE2E2;

  /* Override Primer's GitHub blue accent with our teal. */
  --fgColor-accent: var(--brand-primary);
  --bgColor-accent-emphasis: var(--brand-primary);
  --bgColor-accent-muted: #ccfbf1;

  --max-content: 1200px;
  --max-content-wide: 1400px;
  --max-prose: 62ch;

  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  --t-fast: 140ms;
  --t-base: 240ms;
  --t-slow: 420ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --topbar-height: 68px;
}

[data-color-mode="dark"] {
  --brand-primary: #2DD4BF;
  --brand-primary-hover: #5EEAD4;
  --brand-accent: #FB923C;
  --brand-accent-hover: #FDBA74;

  --semantic-active: #60A5FA;
  --semantic-active-soft: rgba(96, 165, 250, 0.16);
  --semantic-inactive: #F87171;
  --semantic-inactive-soft: rgba(248, 113, 113, 0.16);

  --fgColor-accent: var(--brand-primary);
  --bgColor-accent-emphasis: var(--brand-primary);
  --bgColor-accent-muted: rgba(45, 212, 191, 0.15);
}

/* ----------- 2. Base ----------- */

*, *::before, *::after { box-sizing: border-box; }

html { font-family: var(--font-ui); color-scheme: light dark; }
body {
  margin: 0;
  /* Soft off-white page in light mode so cards/surfaces (which use
     --bgColor-default = pure white) visually lift off the page. Dark mode
     keeps Primer's canvas color unchanged. */
  background: #f6f8fa;
  color: var(--fgColor-default);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--t-base), color var(--t-base);
}
[data-color-mode="dark"] body { background: var(--bgColor-default); }
a { color: var(--fgColor-accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand-primary-hover); }

h1, h2, h3, h4 { color: var(--fgColor-default); letter-spacing: -0.01em; }
h2 { font-size: 1.6rem; margin: 0 0 var(--s-3); }
h3 { font-size: 1.1rem; margin: 0 0 var(--s-2); }
p  { margin: 0 0 var(--s-4); }

:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: var(--s-2);
  padding: var(--s-2) var(--s-4);
  background: var(--bgColor-default);
  color: var(--fgColor-default);
  border-radius: var(--r-md);
  z-index: 100;
}
.skip-link:focus { left: var(--s-2); }

.is-active { color: var(--semantic-active); font-weight: 600; }
.is-inactive { color: var(--semantic-inactive); font-weight: 600; }

/* ----------- 3. Layout helpers ----------- */

.section-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 var(--s-5);
}
.section-inner-wide {
  max-width: var(--max-content-wide);
  margin: 0 auto;
  padding: 0 var(--s-5);
}

.section-head {
  margin-bottom: var(--s-6);
  max-width: var(--max-prose);
}
.section-head h1,
.section-head h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  margin: 0 0 var(--s-3);
  letter-spacing: -0.02em;
  position: relative;
  padding-bottom: var(--s-2);
}
.section-head h1 { font-size: clamp(1.9rem, 3vw, 2.4rem); }
.section-head h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.section-head h1::after,
.section-head h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 36px;
  height: 3px;
  border-radius: 2px;
  background: var(--brand-primary);
}
.section-sub {
  color: var(--fgColor-muted);
  margin: 0;
  font-size: 1rem;
}

.breadcrumbs {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--s-4) var(--s-5) 0;
  font-size: 0.85rem;
  color: var(--fgColor-muted);
}
.breadcrumbs a { color: var(--fgColor-muted); }
.breadcrumbs a:hover { color: var(--brand-primary); }
.breadcrumbs-sep { margin: 0 var(--s-2); opacity: 0.5; }
.breadcrumbs-current { color: var(--fgColor-default); font-weight: 500; }

/* ----------- 4. Topbar ----------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bgColor-default) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--borderColor-muted);
}
.topbar-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--s-3) var(--s-5);
  display: flex;
  align-items: center;
  gap: var(--s-5);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  color: var(--fgColor-default);
  font-weight: 600;
  letter-spacing: -0.015em;
}
.wordmark:hover { color: var(--fgColor-default); }
.wordmark-logo {
  height: 52px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.wordmark-text {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.topnav {
  display: flex;
  gap: var(--s-1);
  margin-left: auto;
}
.topnav a {
  color: var(--fgColor-muted);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  font-size: 0.92rem;
  font-weight: 500;
  transition: background-color var(--t-fast), color var(--t-fast);
}
.topnav a:hover { background: var(--bgColor-muted); color: var(--fgColor-default); }
.topnav a[aria-current="page"] { color: var(--fgColor-default); background: var(--bgColor-muted); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  color: var(--fgColor-muted);
  border: 1px solid var(--borderColor-muted);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--bgColor-muted); color: var(--fgColor-default); border-color: var(--borderColor-default); }
.theme-toggle .icon { display: none; }
[data-color-mode="light"] .theme-toggle .icon-sun { display: block; }
[data-color-mode="dark"] .theme-toggle .icon-moon { display: block; }

.topbar-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  color: var(--fgColor-muted);
  border: 1px solid var(--borderColor-muted);
  border-radius: var(--r-md);
  cursor: pointer;
  flex-shrink: 0;
}
.topbar-mobile-toggle:hover { background: var(--bgColor-muted); color: var(--fgColor-default); }

/* Dark-mode trick for any lab-logo image: invert luminance + rotate hue back so
   teal/orange emblem colors survive and the ring text stays legible. */
[data-color-mode="dark"] .wordmark-logo,
[data-color-mode="dark"] .hero-emblem img,
[data-color-mode="dark"] .footer-logo {
  filter: invert(1) hue-rotate(180deg);
}

/* ----------- 5. Mobile drawer ----------- */

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-base) var(--ease-out);
}
.mobile-drawer[aria-hidden="false"] {
  pointer-events: auto;
  opacity: 1;
}
.mobile-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.mobile-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--bgColor-default);
  border-left: 1px solid var(--borderColor-muted);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-4);
  transform: translateX(100%);
  transition: transform var(--t-base) var(--ease-out);
  box-shadow: var(--shadow-floating-medium);
}
.mobile-drawer[aria-hidden="false"] .mobile-drawer-panel { transform: none; }
.mobile-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--borderColor-muted);
}
.mobile-drawer-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fgColor-default);
}
.mobile-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  color: var(--fgColor-muted);
  border: 1px solid var(--borderColor-muted);
  border-radius: var(--r-md);
  cursor: pointer;
}
.mobile-drawer-close:hover { background: var(--bgColor-muted); }
.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.mobile-drawer-nav a {
  display: block;
  padding: var(--s-3) var(--s-3);
  color: var(--fgColor-default);
  border-radius: var(--r-sm);
  font-size: 1rem;
  font-weight: 500;
}
.mobile-drawer-nav a:hover { background: var(--bgColor-muted); }
.mobile-drawer-nav a[aria-current="page"] { background: var(--bgColor-accent-muted); color: var(--brand-primary); }

@media (prefers-reduced-motion: reduce) {
  .mobile-drawer,
  .mobile-drawer-panel { transition: none; }
}

/* ----------- 6. Footer ----------- */

.site-footer {
  border-top: 1px solid var(--borderColor-muted);
  padding: var(--s-6) 0;
  background: var(--bgColor-muted);
  color: var(--fgColor-muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-5);
  align-items: flex-start;
  justify-content: space-between;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-4);
  font-size: 0.9rem;
  color: var(--fgColor-default);
  font-weight: 500;
}
.footer-logo {
  height: 96px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.footer-brand-text { display: flex; flex-direction: column; gap: var(--s-1); }
.footer-brand-text strong {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--fgColor-default);
}
.footer-brand-text span { color: var(--fgColor-muted); font-size: 0.85rem; font-weight: 400; line-height: 1.4; }
.footer-lab {
  font-size: 0.88rem;
  max-width: 30rem;
  line-height: 1.55;
}
.footer-lab strong { display: block; color: var(--fgColor-default); font-weight: 600; margin-bottom: var(--s-1); }
.footer-lab span { display: block; margin-bottom: var(--s-2); }
.footer-lab a { color: var(--brand-primary); display: block; }
.footer-lab a + a { margin-top: 2px; }

/* ----------- 7. Buttons ----------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  font: 500 0.95rem/1 var(--font-ui);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: var(--brand-primary-hover); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--fgColor-default);
  border-color: var(--borderColor-default);
}
.btn-ghost:hover {
  background: var(--bgColor-muted);
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.btn-sm { padding: var(--s-2) var(--s-3); font-size: 0.85rem; }

/* ----------- 8. Form controls ----------- */

.v2-input,
.v2-select {
  font: inherit;
  color: var(--fgColor-default);
  background: var(--bgColor-default);
  border: 1px solid var(--borderColor-default);
  border-radius: var(--r-md);
  padding: var(--s-2) var(--s-3);
  min-height: 40px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.v2-input:focus,
.v2-select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--bgColor-accent-muted);
}
.v2-input::placeholder { color: var(--fgColor-muted); }
.v2-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23718096' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: var(--s-6);
}
[data-color-mode="dark"] .v2-select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%2394A3B8' d='M0 0l5 6 5-6z'/></svg>");
}

.filter-bar {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: var(--s-5);
}
.filter-bar .v2-input { flex: 1 1 260px; min-width: 200px; }

/* ----------- 9. Tables ----------- */

.v2-table-wrap {
  background: var(--bgColor-default);
  border: 1px solid var(--borderColor-muted);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.v2-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.browse-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--bgColor-muted);
  border: 1px solid var(--borderColor-muted);
  border-radius: var(--r-md);
  font-size: 0.9rem;
  color: var(--fgColor-default);
}
.browse-legend > strong { flex-basis: 100%; margin-bottom: 4px; }
.browse-legend > span { flex: 1 1 240px; color: var(--fgColor-muted); }
.browse-legend > span b { color: var(--fgColor-default); }

.th-help {
  margin-left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--borderColor-muted);
  background: transparent;
  color: var(--fgColor-muted);
  font-size: 11px;
  line-height: 14px;
  cursor: help;
  padding: 0;
  vertical-align: middle;
}
.th-help:hover,
.th-help:focus-visible {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
  outline: none;
}

.v2-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--bgColor-default);
}
.v2-table thead th {
  position: sticky;
  top: 0;
  background: var(--bgColor-inset);
  color: var(--fgColor-default);
  font-weight: 600;
  text-align: left;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--borderColor-default);
  white-space: nowrap;
  z-index: 1;
}
.v2-table thead th[data-sort] {
  cursor: pointer;
  user-select: none;
}
.v2-table thead th[data-sort]::after {
  content: " ⇅";
  opacity: 0.35;
  font-size: 0.85em;
}
.v2-table thead th[aria-sort="ascending"]::after { content: " ▲"; opacity: 1; color: var(--brand-primary); }
.v2-table thead th[aria-sort="descending"]::after { content: " ▼"; opacity: 1; color: var(--brand-primary); }
.v2-table tbody td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--borderColor-muted);
  vertical-align: top;
}
.v2-table tbody tr:last-child td { border-bottom: 0; }
.v2-table tbody tr:hover { background: var(--bgColor-muted); }
.v2-table tbody tr.significant-row { background: color-mix(in srgb, var(--brand-accent) 8%, transparent); }
.v2-table tbody tr.significant-row:hover { background: color-mix(in srgb, var(--brand-accent) 14%, transparent); }
.v2-table .num { font-variant-numeric: tabular-nums; text-align: right; }
.v2-table .positive-delta { color: var(--semantic-active); font-weight: 600; }
.v2-table .negative-delta { color: var(--semantic-inactive); font-weight: 600; }

.v2-table-toolbar {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  flex-wrap: wrap;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--borderColor-muted);
  background: var(--bgColor-default);
}
.v2-table-toolbar .v2-input { flex: 1 1 200px; min-width: 180px; }

.v2-pagination {
  display: flex;
  gap: var(--s-1);
  align-items: center;
  flex-wrap: wrap;
  padding: var(--s-3) var(--s-4);
  border-top: 1px solid var(--borderColor-muted);
  background: var(--bgColor-default);
  font-size: 0.88rem;
}
.v2-pagination button,
.v2-pagination .v2-select {
  font: inherit;
  color: var(--fgColor-default);
  background: var(--bgColor-default);
  border: 1px solid var(--borderColor-muted);
  border-radius: var(--r-sm);
  padding: var(--s-1) var(--s-3);
  min-height: 32px;
  cursor: pointer;
  transition: background-color var(--t-fast), border-color var(--t-fast);
}
.v2-pagination button:hover:not(:disabled) { background: var(--bgColor-muted); border-color: var(--borderColor-default); }
.v2-pagination button[aria-current="page"] { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.v2-pagination button:disabled { opacity: 0.4; cursor: default; }
.v2-pagination .v2-pagination-info { color: var(--fgColor-muted); margin-left: auto; }

/* ----------- 10. Badges ----------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--bgColor-muted);
  color: var(--fgColor-default);
}
.badge-teal {
  background: var(--bgColor-accent-muted);
  color: var(--brand-primary);
}
.badge-accent {
  background: color-mix(in srgb, var(--brand-accent) 18%, transparent);
  color: var(--brand-accent);
}
.badge-active   { background: var(--semantic-active-soft);   color: var(--semantic-active); }
.badge-inactive { background: var(--semantic-inactive-soft); color: var(--semantic-inactive); }
.badge-pathogenic { background: var(--semantic-inactive-soft); color: var(--semantic-inactive); }
.badge-benign     { background: color-mix(in srgb, #10B981 20%, transparent); color: #047857; }
.badge-ambiguous  { background: color-mix(in srgb, #F59E0B 20%, transparent); color: #B45309; }
.badge-high { background: var(--semantic-inactive-soft); color: var(--semantic-inactive); }
.badge-med  { background: color-mix(in srgb, var(--brand-accent) 18%, transparent); color: var(--brand-accent); }
.badge-low  { background: var(--bgColor-muted); color: var(--fgColor-muted); }
[data-color-mode="dark"] .badge-benign { color: #34D399; }
[data-color-mode="dark"] .badge-ambiguous { color: #FCD34D; }

/* ----------- 11. Callouts ----------- */

.callout {
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--borderColor-muted);
  border-left: 3px solid var(--brand-primary);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--brand-primary) 5%, var(--bgColor-default));
  color: var(--fgColor-default);
  margin: 0 0 var(--s-5);
}
.callout-accent {
  border-left-color: var(--brand-accent);
  background: color-mix(in srgb, var(--brand-accent) 5%, var(--bgColor-default));
}
.callout-head {
  font-weight: 600;
  margin-bottom: var(--s-2);
  color: var(--fgColor-default);
}
.callout p:last-child { margin-bottom: 0; }

/* ----------- 12. Collapsibles ----------- */

.collapsible {
  border: 1px solid var(--borderColor-muted);
  border-radius: var(--r-md);
  background: var(--bgColor-default);
  margin-bottom: var(--s-4);
  overflow: hidden;
}
.collapsible-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-3) var(--s-4);
  background: var(--bgColor-default);
  color: var(--fgColor-default);
  font: 600 1rem/1.3 var(--font-ui);
  border: 0;
  cursor: pointer;
  text-align: left;
  gap: var(--s-3);
}
.collapsible-head:hover { background: var(--bgColor-muted); }
.collapsible-head .collapsible-icon {
  font-size: 0.7rem;
  color: var(--fgColor-muted);
  transition: transform var(--t-fast);
  flex-shrink: 0;
}
.collapsible-head[aria-expanded="true"] .collapsible-icon { transform: rotate(90deg); }
.collapsible-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t-base) var(--ease-out);
  padding: 0 var(--s-4);
}
.collapsible-head[aria-expanded="true"] + .collapsible-body {
  max-height: 3000px;
  padding: var(--s-4);
}

/* ----------- 13. Tooltips (CSS only, repositioned by JS) ----------- */

[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  background: var(--fgColor-default);
  color: var(--bgColor-default);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  white-space: normal;
  max-width: 280px;
  width: max-content;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast);
  z-index: 40;
  box-shadow: var(--shadow-floating-small);
}
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after { opacity: 1; }
[data-tooltip-position="bottom"]::after { top: calc(100% + 6px); bottom: auto; }
[data-tooltip-position="left"]::after  { left: auto; right: calc(100% + 6px); bottom: 50%; transform: translateY(50%); }
[data-tooltip-position="right"]::after { left: calc(100% + 6px); bottom: 50%; transform: translateY(50%); }
@media (max-width: 600px) {
  [data-tooltip]::after { display: none; }
}

/* ----------- 14. Reveal animations ----------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 60ms);
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ----------- 15. Snake plot (GPCRdb-style topology viewer) ----------- */

.snake-plot-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: var(--s-4) 0;
  align-items: center;
}
.snake-btn {
  padding: 7px 14px;
  background: var(--bgColor-default);
  color: var(--fgColor-muted);
  border: 1px solid var(--borderColor-muted);
  border-radius: var(--r-sm);
  cursor: pointer;
  font: 500 0.85rem/1 var(--font-ui);
  transition: border-color var(--t-fast), color var(--t-fast), background-color var(--t-fast);
}
.snake-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
.snake-btn.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}
.snake-links-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--fgColor-default);
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  padding: 4px 10px;
  border: 1px solid var(--borderColor-muted);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.snake-links-toggle:hover { border-color: var(--brand-primary); }
.snake-links-toggle:has(input:checked) {
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
}
.snake-links-toggle input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--brand-primary);
}
.snake-links-icon {
  font-size: 1rem;
  line-height: 1;
}
#snake-legend {
  margin: var(--s-3) 0 var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--bgColor-muted);
  border: 1px solid var(--borderColor-muted);
  border-radius: var(--r-md);
  min-height: 40px;
}
.snake-legend-title {
  font-weight: 600;
  color: var(--fgColor-default);
  margin-bottom: 3px;
}
.snake-legend-desc {
  font-size: 0.85rem;
  color: var(--fgColor-muted);
  margin-bottom: 8px;
}
.snake-legend-gradient {
  height: 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--borderColor-muted);
}
.snake-legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--fgColor-muted);
  margin-top: 4px;
}
.snake-legend-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.snake-legend-swatch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--fgColor-muted);
}
.swatch-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid var(--borderColor-muted);
}
/* Snake plot is rendered by ouroboros with baked-in light colors. Always
   display it on a white plate (even in dark mode) so the SVG ring text +
   residue outlines stay legible. */
#snake-plot-container {
  background: #ffffff;
  border: 1px solid var(--borderColor-muted);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
}
#snake-plot-container .long { display: none; }
#snake-plot-container .segment { cursor: pointer; }
#snake-plot-container svg {
  width: 100%;
  height: auto;
  max-width: min(100%, 1400px);
  display: block;
}
@media (max-width: 600px) {
  #snake-plot-container { padding: var(--s-2); }
}
#snake-links path { transition: opacity var(--t-fast), stroke-width var(--t-fast); }
#snake-links path:hover { opacity: 1; stroke-width: 4; }

/* ----------- 16. Chart containers (Plotly) ----------- */

.v2-chart {
  width: 100%;
  min-height: 320px;
  background: var(--bgColor-default);
  border: 1px solid var(--borderColor-muted);
  border-radius: var(--r-md);
  padding: var(--s-3);
  margin: 0 0 var(--s-4);
}
.v2-chart-wide { min-height: 420px; }

/* ----------- 17. Responsive chrome ----------- */

@media (max-width: 600px) {
  .topnav { display: none; }
  .topbar-mobile-toggle { display: inline-flex; }
  .wordmark-logo { height: 40px; }
  .wordmark-text { font-size: 1.05rem; }
  .footer-logo { height: 72px; }
  .v2-table thead th,
  .v2-table tbody td { padding: var(--s-2) var(--s-3); font-size: 0.85rem; }
}
