/* Glass, after the glassmorphism guide (DESIGN.md / SKILL.md): panels with no colour of their own, white-neutral and translucent, over a
 * background that is rich and moves slowly. The colour of a panel is the colour behind it, blurred and brightened through the glass.
 *
 * Loaded after the page's own <style>, it restates what changes: tokens (dark and light), type, surfaces, controls, motion. Rules kept from the guide:
 *   - glass fill is always rgba(255,255,255,N); no coloured fills, no glowing coloured borders, no pulsing halos
 *   - every glass edge has a 1px border and a 1px specular line along the top (2px in light mode)
 *   - the primary button is solid; buttons, inputs and tags are pills; icons are inline line SVG, with no box around them
 *   - blur is used on at most three layers at a time (header, the big panel, an overlay), never inside one another
 *   - only transform and opacity move; `prefers-reduced-motion` and `prefers-reduced-transparency` are honoured
 */

:root {
  /* ---- the scene ---- */
  --bg-primary: light-dark(#f0ebe3, #060a12);
  --bg-secondary: light-dark(#e7e1d7, #0c1220);
  --blob-1: light-dark(#a78bfa, #10b981);   /* dark: jade, the green of the mark */
  --blob-2: light-dark(#5eead4, #7c3aed);   /* dark: violet, the purple of the mark */
  --blob-3: light-dark(#fb923c, #0369a1);   /* dark: deep blue */
  --blob-opacity: 0.55;
  --helix-opacity: 0.85;

  /* ---- glass ---- */
  --glass-bg: light-dark(rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.08));
  --glass-bg-hover: light-dark(rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.13));
  --glass-bg-soft: light-dark(rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.05));
  --glass-border: light-dark(rgba(255, 255, 255, 0.70), rgba(255, 255, 255, 0.12));
  --glass-border-hover: light-dark(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.22));
  --spec: light-dark(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.20));
  --spec-w: 1px;
  --glass-blur: blur(20px) saturate(180%);
  --glass-shadow: 0 12px 40px light-dark(rgba(60, 45, 20, 0.14), rgba(0, 0, 0, 0.35));
  --glass-shadow-hover: 0 20px 60px light-dark(rgba(60, 45, 20, 0.22), rgba(0, 0, 0, 0.50));
  --glass-specular: 0 var(--spec-w) 0 0 var(--spec) inset;

  /* ---- text ---- */
  --text-primary: light-dark(rgba(20, 16, 12, 0.90), rgba(238, 246, 255, 0.95));
  --text-secondary: light-dark(rgba(20, 16, 12, 0.66), rgba(214, 228, 245, 0.68));
  --text-muted: light-dark(rgba(20, 16, 12, 0.50), rgba(190, 210, 235, 0.46));

  /* ---- accent: solid, for the primary action and the interactive states only ---- */
  --accent-primary: light-dark(#0f766e, #5eead4);
  --on-accent-primary: light-dark(#ffffff, #052e2a);

  --font-head: 'Outfit', 'DM Sans', system-ui, sans-serif;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --radius-pill: 999px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* ---- the names the page's own style uses, mapped onto the tokens ---- */
  --bg: var(--bg-primary);
  --surface: var(--glass-bg);
  --surface2: light-dark(rgba(255, 255, 255, 0.40), rgba(255, 255, 255, 0.09));
  --surface3: light-dark(rgba(20, 16, 12, 0.08), rgba(255, 255, 255, 0.15));
  --border: light-dark(rgba(20, 16, 12, 0.13), rgba(255, 255, 255, 0.13));
  --border-strong: light-dark(rgba(20, 16, 12, 0.34), rgba(255, 255, 255, 0.30));
  --text: var(--text-primary);
  --text-dim: var(--text-secondary);
  --accent: light-dark(#0f766e, #5eead4);
  --accent-fill: var(--accent-primary);
  --accent-fill-hover: var(--accent-primary);
  --on-accent: var(--on-accent-primary);
  --focus: light-dark(#0f766e, #99f6e4);
  --shadow-color: light-dark(rgba(60, 45, 20, 0.16), rgba(0, 0, 0, 0.45));
  --radius: 20px;
  --radius-sm: 12px;
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --row-bg: light-dark(rgba(250, 247, 242, 0.80), rgba(12, 17, 32, 0.78));
}
:root[data-theme="light"] { --spec-w: 2px; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --spec-w: 2px; } }

/* ---- the scene: a dark gradient and three slow blobs behind everything ---- */
html { scroll-padding-top: 96px; }
body { background: var(--bg-primary); color: var(--text-primary); font-family: var(--font); font-size: 15px; }
.bg-scene {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: linear-gradient(160deg, var(--bg-primary), var(--bg-secondary));
}
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--blob-opacity); animation: blob-float 10s ease-in-out infinite; will-change: transform; }
.blob-1 { width: 650px; height: 650px; background: var(--blob-1); top: -180px; left: -180px; }
.blob-2 { width: 450px; height: 450px; background: var(--blob-2); bottom: -120px; right: -120px; animation-delay: -4s; }
.blob-3 { width: 350px; height: 350px; background: var(--blob-3); top: 45%; left: 45%; animation-delay: -7s; }
@keyframes blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -40px) scale(1.06); }
  66% { transform: translate(-25px, 25px) scale(0.95); }
}
.site-header, main, footer { position: relative; z-index: 1; }

/* ---- type ---- */
h1, h2, h3, .brand h1, .hero-title, .stat-value, .step-header h2 { font-family: var(--font-head); letter-spacing: -0.01em; }
code, .mono, kbd { font-family: var(--mono); }
a { color: var(--accent); text-underline-offset: 3px; }
.lede { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.75; max-width: 62ch; margin: 0; }
.hero { padding: 56px 0 44px; }
.eyebrow {
  display: inline-block; padding: 5px 14px; margin-bottom: 20px; border-radius: var(--radius-pill);
  background: var(--glass-bg-soft); border: 1px solid var(--glass-border); box-shadow: var(--glass-specular);
  font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary);
}
.hero-title { font-size: clamp(2.2rem, 4.6vw, 3.9rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; margin-bottom: 18px; max-width: 20ch; text-wrap: balance; }

/* ---- layout: airy; the genome and the variants side by side on a wide screen ---- */
.container { max-width: 1320px; padding: 8px 40px 88px; }
main.container { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 28px; align-items: start; }
main.container > * { grid-column: 1 / -1; }
main.container > #genomeCard { grid-column: 1; }
main.container > #variantsCard { grid-column: 2; }
main.container > .card { margin-bottom: 0; }
@media (max-width: 980px) {
  .container { padding: 8px 20px 64px; }
  main.container { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  main.container > #genomeCard, main.container > #variantsCard { grid-column: 1 / -1; }
  .hero { padding: 36px 0 28px; }
}

/* ---- the nav: sticky glass, a line under it and no shadow ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: light-dark(rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.06));
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--glass-border); box-shadow: none;
}
.site-header-inner { max-width: 1320px; padding: 14px 40px; }
@media (max-width: 980px) { .site-header-inner { padding: 12px 20px; } }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; box-shadow: var(--glass-specular), 0 4px 16px var(--shadow-color); }
.brand h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.brand h1 .q-green { color: light-dark(#0f766e, #5eead4); }
.brand h1 .q-purple { color: light-dark(#6d28d9, #c4b5fd); }
.counters { color: var(--text-muted); }
.theme-toggle { gap: 8px; }
.theme-toggle svg { display: block; }
.theme-toggle #themeIcon { display: inline-flex; }

/* ---- glass panels ---- */
.card, .results-panel, .summary-card, .menu-panel, .alert, .status-bar, .acmg-banner, .demo-banner, dialog.dialog {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular), var(--glass-shadow);
}
.card, .results-panel, .menu-panel, dialog.dialog, .alert, .status-bar, .acmg-banner, .demo-banner {
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.card { position: relative; border-radius: var(--radius-xl); padding: 32px; }
/* the premium edge: light catches the top-left corner and is gone by the bottom-right */
.card::before, .results-header::before, .results-panel::before, .summary-card::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, light-dark(rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.32)) 0%,
    light-dark(rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0.08)) 40%, rgba(255, 255, 255, 0) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: destination-out;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude;
}
.step-header { gap: 14px; margin-bottom: 6px; }
.step-header h2 { font-size: 1.2rem; font-weight: 700; text-transform: none; letter-spacing: -0.01em; }
.step-badge {
  width: auto; height: 28px; min-width: 28px; padding: 0 9px; border-radius: var(--radius-pill);
  background: var(--glass-bg-hover); color: var(--text-primary); border: 1px solid var(--glass-border-hover);
  box-shadow: var(--glass-specular); font-family: var(--font-head); font-weight: 700; font-size: 13px;
}
.step-sub { color: var(--text-secondary); line-height: 1.7; margin: 8px 0 20px; }
/* the content of a step lines up with its title: no indent under the badge any more */
.step-sub, .genome-row, .genome-info, .file-picker, .admin-note, .provenance { margin-left: 0; }
.field-label { color: var(--text-muted); font-weight: 500; letter-spacing: 0.04em; }

/* ---- the results sheet ---- */
.results-header {
  /* the heading of the results (step 3, where they come from, the downloads and the counts) is a card of its own */
  position: relative; margin: 40px 0 24px; padding: 28px 32px; gap: 20px 32px; align-items: center; justify-content: space-between;
  border-radius: var(--radius-xl); background: var(--glass-bg); border: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular), var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
/* the title may shrink and wrap so that the downloads and the counts sit beside it on a wide screen */
.results-title { flex: 1 1 360px; min-width: 0; }
.results-actions { flex: 0 1 auto; margin-left: auto; justify-content: flex-end; }
@media (max-width: 980px) { .results-header { padding: 22px 20px; margin-top: 28px; } }
.results-title .step-header h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); font-weight: 700; }
.provenance { color: var(--text-secondary); margin-left: 0; }
.results-panel { position: relative; border-radius: var(--radius-xl); border-top: 1px solid var(--glass-border); overflow: hidden; }
.tabs {
  width: fit-content; max-width: 100%; margin-bottom: 18px; padding: 5px; gap: 4px; border-radius: var(--radius-pill);
  background: var(--glass-bg); border: 1px solid var(--glass-border); box-shadow: var(--glass-specular);
}
.tab { border-radius: var(--radius-pill); border: 0; padding: 9px 22px; color: var(--text-secondary); transition: background .2s, color .2s, transform .18s var(--spring); }
.tab:hover { color: var(--text-primary); }
.tab:active { transform: scale(0.97); }
.tab[aria-selected="true"] { background: var(--glass-bg-hover); color: var(--text-primary); box-shadow: var(--glass-specular); }
.toolbar { padding: 16px 20px; border-bottom-color: var(--border); }
.stats { gap: 12px; }
.stat {
  min-width: 84px; padding: 10px 18px; border-radius: 18px; align-items: flex-start;
  background: var(--glass-bg); border: 1px solid var(--glass-border); box-shadow: var(--glass-specular);
}
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); }
.stat-label { color: var(--text-muted); letter-spacing: 0.06em; }
.download-group { gap: 8px; color: var(--text-muted); }

/* ---- the summary and the Inspect cards: lighter glass inside the sheet (no blur on blur), they lift on hover ---- */
.summary-grid, .inspect-cards { gap: 24px; }
.summary-grid { padding: 28px; }
.summary-card {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 28px;
  background: var(--glass-bg-soft); box-shadow: var(--glass-specular), 0 8px 28px light-dark(rgba(60, 45, 20, 0.10), rgba(0, 0, 0, 0.25));
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease, transform .25s var(--spring);
}
.summary-card:hover { background: var(--glass-bg); border-color: var(--glass-border-hover); box-shadow: var(--glass-specular), var(--glass-shadow-hover); transform: translateY(-4px); }
.summary-card::after {
  content: ""; position: absolute; top: 0; left: 0; width: 50%; height: 100%; z-index: 1; pointer-events: none;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.07) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg) translateX(-200%); transition: transform .65s ease;
}
.summary-card:hover::after { transform: skewX(-18deg) translateX(500%); }
.summary-card h3 { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 14px; }
.inspect-cards { padding: 4px 0 28px; }
/* cards keep their own height: a short card is not stretched to the length of the tallest one beside it */
.inspect-cards, .summary-grid { align-items: start; }
/* the long Functional card takes the height of several rows, and the others fill in beside it */
.inspect-cards { grid-auto-flow: dense; }
.inspect-cards > .summary-card:first-child { grid-row: span 4; }
@media (max-width: 760px) { .inspect-cards > .summary-card:first-child { grid-row: auto; } }
.splice-table thead th:first-child, .splice-table tbody th { text-align: left; }
/* one column for each value: the pills of a column share an axis (centred), and each tool starts after a thin rule */
.splice-table { table-layout: auto; }
.splice-table th, .splice-table td { text-align: center; white-space: nowrap; }
.splice-table thead th:first-child, .splice-table tbody th { text-align: left; }
.splice-table .splice-first { border-left: 1px solid var(--glass-border); }
/* the junction effects are a table of their own under the first: the first column has the same width in both, the others are free */
.splice-table th:first-child, .splice-table td:first-child { width: 150px; }
.splice-table.splice-junctions { margin-top: 18px; }
/* the splice table has five pill columns: it takes two columns of the grid, and never clips */
.inspect-cards .summary-card:has(.splice-table) { grid-column: span 2; }
.summary-card { overflow-x: clip; }
@media (max-width: 760px) { .inspect-cards .summary-card:has(.splice-table) { grid-column: auto; } .splice-table { display: block; overflow-x: auto; } }
.inspect-cards .summary-card { background: var(--glass-bg-soft); }
.inspect-cards .record-heading { color: var(--text-muted); letter-spacing: 0.04em; }
.kv dt { color: var(--text-secondary); }
.empty-note, .summary-note { color: var(--text-muted); }

/* ---- controls: pills; the primary action is solid ---- */
.btn { border-radius: var(--radius-pill); font-weight: 600; padding-inline: 22px; transition: transform .18s var(--spring), filter .18s ease, background .2s ease, border-color .2s ease, box-shadow .18s ease; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.97); transition-duration: .08s; }
.btn-primary { background: var(--accent-primary); color: var(--on-accent-primary); border: 0; box-shadow: 0 4px 20px light-dark(rgba(15, 118, 110, 0.35), rgba(0, 0, 0, 0.30)); }
.btn-primary:hover:not(:disabled) { background: var(--accent-primary); transform: translateY(-2px); filter: brightness(1.1); }
.btn-secondary {
  background: var(--glass-bg); color: var(--text-primary); border: 1px solid var(--glass-border); box-shadow: var(--glass-specular);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.btn-secondary:hover:not(:disabled) { background: var(--glass-bg-hover); border-color: var(--glass-border-hover); transform: translateY(-2px); }
.btn-ghost { border-radius: var(--radius-pill); border-color: var(--glass-border); }
.btn-ghost:hover:not(:disabled) { background: var(--glass-bg); transform: translateY(-1px); }
.btn-sm { padding-inline: 16px; }
.btn-lg { padding-inline: 32px; }

select, input[type="search"], input[type="text"] {
  background: var(--glass-bg-soft); color: var(--text-primary); border: 1px solid var(--glass-border); border-radius: var(--radius-pill);
  padding: 10px 20px; box-shadow: var(--glass-specular);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background .2s, border-color .2s, box-shadow .2s;
}
select { padding-right: 14px; }
textarea {
  background: var(--glass-bg-soft); color: var(--text-primary); border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  padding: 16px 20px; box-shadow: var(--glass-specular);
  transition: background .2s, border-color .2s, box-shadow .2s;
}
textarea::placeholder, input::placeholder { color: var(--text-muted); }
textarea:focus-visible, select:focus-visible, input:focus-visible {
  outline: none; background: var(--glass-bg); border-color: light-dark(rgba(20, 16, 12, 0.45), rgba(255, 255, 255, 0.34));
  box-shadow: 0 0 0 3px light-dark(rgba(15, 118, 110, 0.20), rgba(255, 255, 255, 0.07)), var(--glass-specular);
}
input.col-filter { border-radius: var(--radius-pill); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; padding: 5px 12px; min-height: 28px; }
input.col-filter.active { border-color: var(--accent); background: light-dark(rgba(15, 118, 110, 0.10), rgba(94, 234, 212, 0.10)); }
.check { background: var(--glass-bg-soft); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); box-shadow: var(--glass-specular); transition: background .2s, border-color .2s; }
.check:hover { background: var(--glass-bg); border-color: var(--glass-border-hover); }
.check input, .menu-panel input { accent-color: var(--accent-primary); }
.chip { border-radius: var(--radius-pill); color: var(--text-secondary); background: var(--glass-bg-soft); border: 1px solid var(--glass-border); box-shadow: var(--glass-specular); transition: background .2s, border-color .2s, transform .18s var(--spring); }
.chip:hover { background: var(--glass-bg-hover); border-color: var(--glass-border-hover); color: var(--text-primary); transform: translateY(-2px); }
.badge, .mode-pill { background: var(--glass-bg); color: var(--text-secondary); border: 1px solid var(--glass-border); }
.genome-info { color: var(--text-secondary); line-height: 1.7; }
.genome-info strong, .provenance strong { color: var(--text-primary); }
.hint { color: var(--text-muted); }
.hint kbd { background: var(--glass-bg-soft); border: 1px solid var(--glass-border); border-radius: 6px; }

/* ---- messages ---- */
.alert { border-radius: var(--radius-lg); border-left: 1px solid var(--glass-border); padding: 16px 20px; gap: 14px; }
.alert .alert-icon, .banner-icon { background: none; border: 0; box-shadow: none; width: auto; height: auto; display: inline-flex; flex-shrink: 0; margin-top: 1px; }
.alert .alert-icon svg, .banner-icon svg { display: block; }
.alert-error .alert-title, .alert-error .alert-icon { color: var(--high); }
.alert-warning .alert-title, .alert-warning .alert-icon { color: var(--moderate); }
.alert-info .alert-title, .alert-info .alert-icon { color: var(--accent); }
.status-bar { border-radius: var(--radius-pill); border-left: 1px solid var(--glass-border); padding: 12px 22px; background: var(--glass-bg); }
.status-bar .spinner { color: var(--accent); }
#statusIcon { display: inline-flex; color: var(--accent); }
.acmg-banner, .demo-banner { border-radius: var(--radius-lg); }

/* ---- overlays: the heaviest glass ---- */
.menu-panel {
  background: light-dark(rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.10));
  -webkit-backdrop-filter: blur(28px) saturate(200%); backdrop-filter: blur(28px) saturate(200%);
  border-radius: var(--radius-lg); border-color: var(--glass-border-hover);
  box-shadow: var(--glass-specular), 0 20px 60px light-dark(rgba(60, 45, 20, 0.25), rgba(0, 0, 0, 0.40));
}
.menu-panel label { border-radius: 10px; }
.menu-panel label:hover { background: var(--surface2); }
dialog.dialog {
  background: light-dark(rgba(250, 247, 242, 0.82), rgba(18, 24, 44, 0.62));
  -webkit-backdrop-filter: blur(28px) saturate(200%); backdrop-filter: blur(28px) saturate(200%);
  border-radius: var(--radius-xl); color: var(--text-primary);
}
dialog.dialog::backdrop { background: light-dark(rgba(240, 235, 227, 0.55), rgba(3, 6, 14, 0.62)); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* ---- the table: legible rows; the heading and the first column stay nearly solid ---- */
.table-wrapper { background: transparent; border: 0; border-radius: 0; }
thead th {
  background: light-dark(rgba(246, 242, 235, 0.94), rgba(14, 19, 36, 0.94));
  color: var(--text-secondary); font-weight: 500; letter-spacing: 0.04em;
}
.th-btn { color: inherit; }
tbody tr { --row-bg: light-dark(rgba(250, 247, 242, 0.80), rgba(12, 17, 32, 0.78)); }
tbody tr:hover { --row-bg: light-dark(rgba(255, 255, 255, 0.96), rgba(30, 40, 72, 0.92)); }
td, th { border-color: var(--border); }
.sort-ind { color: var(--accent); }
th[aria-sort="ascending"] .sort-ind::before, th[aria-sort="descending"] .sort-ind::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.75px 1.75px 0; border-radius: 1px;
}
th[aria-sort="ascending"] .sort-ind::before { transform: translateY(1px) rotate(-135deg); }
th[aria-sort="descending"] .sort-ind::before { transform: translateY(-2px) rotate(45deg); }
.pager { padding: 14px 20px; }
.pager svg { display: block; }
.pager .btn { padding-inline: 14px; }
.loc-link { color: var(--accent); }

/* ---- tags: small pills; those the data colours keep their colour, with a thin line of it ---- */
.pill, .tag, .impact, .mane, .acmg-badge { border-radius: var(--radius-pill); border: 1px solid transparent; }
.pill:not([style*="--pill"]), .tag:not([style*="--pill"]) { background: var(--glass-bg); border-color: var(--glass-border); color: var(--text-secondary); }
.impact[style*="--pill"], .mane[style*="--pill"], .tag[style*="--pill"], .pill[style*="--pill"] { border-color: color-mix(in srgb, var(--pill) 40%, transparent); }
.bar-track { background: light-dark(rgba(20, 16, 12, 0.09), rgba(255, 255, 255, 0.09)); border-radius: var(--radius-pill); }
.bar-fill { border-radius: var(--radius-pill); }
.splice-table thead th { background: transparent; }

/* ---- the genome browser sits in a glass frame ---- */
/* the genome browser draws its own glass (assets/igv-glass.css, added to its shadow root): this box only holds it */
.igv-host { background: transparent; border: 0; border-radius: var(--radius-lg); overflow: visible; }

footer { padding: 56px 20px 48px; color: var(--text-muted); }

/* ---- motion: rise into view, once. Scroll-driven where the browser can, on insertion where it cannot ---- */
@keyframes rise { from { opacity: 0; transform: translateY(24px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
.hero > *, .card, .results-header, .tabs, .results-panel, .alert, .status-bar { animation: rise .7s var(--spring) both; }
.hero > :nth-child(2) { animation-delay: .08s; }
.hero > :nth-child(3) { animation-delay: .16s; }
main.container > #variantsCard { animation-delay: .1s; }
@supports (animation-timeline: view()) {
  /* a fixed distance, not a share of the height: the results sheet is thousands of pixels tall and must not wait for 30% of it */
  .card, .summary-card, .results-panel { animation: rise linear both; animation-timeline: view(); animation-range: entry 0px entry 220px; }
}

/* ---- fallbacks ---- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass-bg: light-dark(rgba(250, 247, 242, 0.92), rgba(20, 26, 46, 0.90)); --glass-bg-soft: light-dark(rgba(250, 247, 242, 0.80), rgba(20, 26, 46, 0.75)); --glass-bg-hover: light-dark(#fffdf8, rgba(30, 38, 66, 0.95)); }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass-bg: light-dark(#faf7f2, #141a2e); --glass-bg-soft: light-dark(#f4f0e8, #10162a); --glass-bg-hover: light-dark(#ffffff, #1b2340); }
  .site-header, .card, .results-header, .results-panel, .menu-panel, dialog.dialog, .alert, .status-bar, .acmg-banner, .demo-banner, .btn-secondary, select, input, .check {
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  /* the helix is not switched off (it would flatten): it stands still in a twisted pose */
  .helix, .helix * { animation-play-state: paused !important; }
  *:not(.helix, .helix *), *:not(.helix, .helix *)::before, *:not(.helix, .helix *)::after { animation: none !important; transition-duration: .01ms !important; }
  .blob { animation: none; }
  .hero > *, .card, .results-header, .tabs, .results-panel, .alert, .status-bar, .summary-card { opacity: 1; transform: none; filter: none; }
}

/* ---- the gauge: a glass track that goes from green (benign) to red (pathogenic), a mark at the score ---- */
:root {
  --benign: light-dark(#15803d, #4ade80);
  --pathogenic: light-dark(#b91c1c, #f87171);
}
/* a gauge row is three columns: the name, the score (its right edge against the gauge) and a gauge of one fixed size, the same on every row */
.kv > .gauge-item {
  grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 72px 150px; align-items: center; column-gap: 10px;
  padding: 0 0 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border);
}
.kv > .gauge-item dd { display: contents; }
.gauge { width: 150px; display: flex; flex-direction: column; gap: 5px; font-weight: 500; }
.gauge-ends { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1; }
.gauge-lo { color: var(--benign); }
.gauge-hi { color: var(--pathogenic); }
.gauge-hi.gauge-neutral { color: var(--text-muted); } /* a gauge with no pathogenic band ends at Neutral */
.kv > .gauge-item[data-gauge] { cursor: help; border-radius: var(--radius-sm); }
.kv > .gauge-item[data-gauge]:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.gauge-track {
  position: relative; height: 10px; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #22c55e 0%, #84cc16 25%, #eab308 50%, #f97316 75%, #ef4444 100%) 0 0 / calc(100% / var(--span, 1)) 100% no-repeat;
  border: 1px solid var(--glass-border); box-shadow: var(--glass-specular), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.gauge-track::after { /* the glass over the colour: a sheen along the top half */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 55%);
}
.gauge-mark {
  position: absolute; left: var(--at); top: -6px; bottom: -6px; width: 3px; border-radius: 2px; transform: translateX(-50%);
  background: var(--mk); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.78), 0 1px 5px rgba(0, 0, 0, 0.45); z-index: 1;
}
.gauge-verdict { position: relative; height: 15px; margin-top: 3px; }
.gauge-verdict > span {
  position: absolute; left: clamp(64px, var(--at), calc(100% - 64px)); transform: translateX(-50%); white-space: nowrap;
  font-size: 11px; font-weight: 600; color: light-dark(color-mix(in srgb, var(--mk) 60%, #000), var(--mk));
}
.kv > .gauge-item dd .pill { justify-self: end; text-align: right; white-space: nowrap; } /* a long value grows to the left, never wraps */

/* ---- the DNA helix: the animated background. Two strands of dots that swing across each other, joined by rungs, in the colours of the blobs.
 * Each rung is a row of three parts (two dots and the bar between them), all moved with `transform` only; a rung is a little later than the one above,
 * which makes the twist run along the helix. The dot in front is larger and brighter. ---- */
.helix { display: none; position: absolute; pointer-events: none; }
body[data-bg="helix"] .helix { display: flex; }
.helix {
  --r: 92px; --d: 14s; --step: 1s; /* a turn every d / step = 14 rungs */
  left: 76%; top: 50%; width: calc(var(--r) * 2 + 60px); height: 170vmax; flex-direction: column; justify-content: space-between;
  transform: translate(-50%, -50%) rotate(-22deg); opacity: var(--helix-opacity, 0.8);
}
.helix.far { --r: 56px; --d: 19s; --step: 2.6s; left: 12%; top: 58%; transform: translate(-50%, -50%) rotate(17deg); opacity: calc(var(--helix-opacity, 0.8) * 0.45); }
.helix .rung { position: relative; display: block; height: 0; }
.helix .rung > * { position: absolute; left: 50%; top: 0; display: block; }
.helix .node { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; will-change: transform; animation: helix-dot var(--d) linear infinite; animation-delay: calc(var(--i) * var(--step) * -1); }
.helix .node.a { background: var(--blob-1); box-shadow: 0 0 18px 3px var(--blob-1); }
.helix .node.b { background: var(--blob-2); box-shadow: 0 0 18px 3px var(--blob-2); animation-delay: calc(var(--i) * var(--step) * -1 - var(--d) / 2); }
.helix .rung.alt .node.a { background: var(--blob-3); box-shadow: 0 0 18px 3px var(--blob-3); }
.helix .bar {
  width: calc(var(--r) * 2); height: 2px; margin: -1px 0 0 calc(var(--r) * -1); border-radius: 2px; will-change: transform;
  background: linear-gradient(90deg, var(--blob-1), var(--blob-2)); opacity: 0.5;
  animation: helix-bar calc(var(--d) / 2) linear infinite; animation-delay: calc(var(--i) * var(--step) * -1);
}
.helix .rung.alt .bar { background: linear-gradient(90deg, var(--blob-3), var(--blob-2)); }
@keyframes helix-dot {
  0% { transform: translateX(calc(var(--r) * 1.0000)) scale(1.000); opacity: 0.720; }
  6.25% { transform: translateX(calc(var(--r) * 0.9239)) scale(1.145); opacity: 0.827; }
  12.5% { transform: translateX(calc(var(--r) * 0.7071)) scale(1.269); opacity: 0.918; }
  18.75% { transform: translateX(calc(var(--r) * 0.3827)) scale(1.351); opacity: 0.979; }
  25% { transform: translateX(calc(var(--r) * 0.0000)) scale(1.380); opacity: 1.000; }
  31.25% { transform: translateX(calc(var(--r) * -0.3827)) scale(1.351); opacity: 0.979; }
  37.5% { transform: translateX(calc(var(--r) * -0.7071)) scale(1.269); opacity: 0.918; }
  43.75% { transform: translateX(calc(var(--r) * -0.9239)) scale(1.145); opacity: 0.827; }
  50% { transform: translateX(calc(var(--r) * -1.0000)) scale(1.000); opacity: 0.720; }
  56.25% { transform: translateX(calc(var(--r) * -0.9239)) scale(0.855); opacity: 0.613; }
  62.5% { transform: translateX(calc(var(--r) * -0.7071)) scale(0.731); opacity: 0.522; }
  68.75% { transform: translateX(calc(var(--r) * -0.3827)) scale(0.649); opacity: 0.461; }
  75% { transform: translateX(calc(var(--r) * -0.0000)) scale(0.620); opacity: 0.440; }
  81.25% { transform: translateX(calc(var(--r) * 0.3827)) scale(0.649); opacity: 0.461; }
  87.5% { transform: translateX(calc(var(--r) * 0.7071)) scale(0.731); opacity: 0.522; }
  93.75% { transform: translateX(calc(var(--r) * 0.9239)) scale(0.855); opacity: 0.613; }
  100% { transform: translateX(calc(var(--r) * 1.0000)) scale(1.000); opacity: 0.720; }
}
@keyframes helix-bar {
  0% { transform: scaleX(1.0000); }
  6.25% { transform: scaleX(0.9239); }
  12.5% { transform: scaleX(0.7071); }
  18.75% { transform: scaleX(0.3827); }
  25% { transform: scaleX(0.0000); }
  31.25% { transform: scaleX(0.3827); }
  37.5% { transform: scaleX(0.7071); }
  43.75% { transform: scaleX(0.9239); }
  50% { transform: scaleX(1.0000); }
  56.25% { transform: scaleX(0.9239); }
  62.5% { transform: scaleX(0.7071); }
  68.75% { transform: scaleX(0.3827); }
  75% { transform: scaleX(0.0000); }
  81.25% { transform: scaleX(0.3827); }
  87.5% { transform: scaleX(0.7071); }
  93.75% { transform: scaleX(0.9239); }
  100% { transform: scaleX(1.0000); }
}
@media (max-width: 760px) { .helix { left: 70%; --r: 62px; } .helix.far { display: none !important; } }

/* ---- the comparison (gnomAD v4.1): the card takes a row of its own; a column for each dataset under a coloured pill ---- */
:root {
  --tone-joint: light-dark(#0f766e, #5eead4);
  --tone-genomes: light-dark(#6d28d9, #c4b5fd);
  --tone-exomes: light-dark(#b45309, #fbbf24);
}
/* the card only clips (the light that sweeps it on hover reaches far outside it, and in a scrolling card that made a scrollbar appear); the comparison scrolls itself when it is narrow */
.inspect-cards .summary-card:has(.cmp) { grid-column: 1 / -1; }
.cmp { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; }
.cmp > * { min-width: 560px; }
.cmp-row { display: grid; grid-template-columns: 210px repeat(3, minmax(0, 1fr)); column-gap: 18px; align-items: center; }
.cmp-head { margin-bottom: 8px; }
.cmp-title { font-family: var(--font-head); font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.cmp-col {
  justify-self: start; padding: 5px 18px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 16%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 42%, transparent);
  box-shadow: var(--glass-specular);
}
/* the sections open and close; the chevron is a turned corner of a border, not an icon in a box */
.cmp-fold { border-top: 1px solid var(--border); margin-top: 12px; }
.cmp-fold:first-of-type { margin-top: 6px; }
.cmp-fold > summary {
  display: flex; align-items: center; gap: 10px; padding: 12px 0 10px; cursor: pointer; list-style: none; user-select: none;
  font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); transition: color .2s;
}
.cmp-fold > summary::-webkit-details-marker { display: none; }
.cmp-fold > summary::before {
  content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.75px 1.75px 0; border-radius: 1px;
  transform: translateY(-1px) rotate(-45deg); transition: transform .25s var(--spring);
}
.cmp-fold[open] > summary::before { transform: translateY(-3px) rotate(45deg); }
.cmp-fold > summary:hover { color: var(--text-secondary); }
.cmp-fold > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.cmp-body { padding-bottom: 6px; display: grid; row-gap: 8px; }
.cmp-label { color: var(--text-secondary); font-size: 13px; line-height: 1.3; }
.cmp-sub { display: block; font-size: 11px; color: var(--text-muted); }
.cmp .pill { justify-self: start; max-width: 100%; overflow-wrap: anywhere; }
.cmp-none { color: var(--text-muted); padding-left: 10px; }
@media (max-width: 760px) { .cmp-row { grid-template-columns: 130px repeat(3, minmax(88px, 1fr)); column-gap: 10px; } }

/* ---- records laid out in columns (Multiplexed Assays): one panel for each experiment, side by side on a row of the card's own ---- */
.inspect-cards .summary-card:has(.record-grid) { grid-column: 1 / -1; }
.record-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.record-grid > .record, .inspect-cards .record-grid > .record + .record {
  margin: 0; padding: 16px 20px; border-radius: 16px; background: var(--glass-bg-soft); border: 1px solid var(--border); box-shadow: var(--glass-specular);
}

/* ---- the popup of a gauge: a heavier glass, like a context menu ---- */
.gauge-tip {
  position: fixed; z-index: 60; width: 380px; max-width: calc(100vw - 16px); padding: 14px 16px 12px; pointer-events: none;
  background: light-dark(rgba(255, 255, 255, 0.78), rgba(24, 30, 46, 0.78)); color: var(--text-primary);
  border: 1px solid var(--glass-border-hover); border-radius: var(--radius-sm);
  box-shadow: var(--glass-specular), var(--glass-shadow-hover);
  -webkit-backdrop-filter: blur(28px) saturate(200%); backdrop-filter: blur(28px) saturate(200%);
  font-size: 12px; line-height: 1.45;
}
.gauge-tip .tip-title { margin: 0 0 4px; font: 700 14px var(--font-head); letter-spacing: -0.01em; }
.gauge-tip .tip-desc { margin: 0 0 10px; color: var(--text-secondary); }
.gauge-tip .tip-bands { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.gauge-tip .tip-bands li { display: grid; grid-template-columns: 10px minmax(0, 1fr) 170px; align-items: center; column-gap: 8px; padding: 3px 8px; border-radius: var(--radius-pill); }
.gauge-tip .tip-bands i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--glass-border-hover); }
.gauge-tip .b-name { font-weight: 600; white-space: nowrap; }
.gauge-tip .b-text { color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.gauge-tip .tip-bands li.now { background: var(--glass-bg-hover); box-shadow: var(--glass-specular), 0 0 0 1px var(--glass-border-hover); }
.gauge-tip .tip-bands li.now .b-text { color: var(--text-primary); font-weight: 600; }
@media (prefers-reduced-transparency: reduce) { .gauge-tip { -webkit-backdrop-filter: none; backdrop-filter: none; background: light-dark(#f4f0e8, #141a2a); } }

/* ---- the + button under the predictors with a slider: it opens the others ---- */
.more-fold { margin-top: 4px; }
.more-fold > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px;
  border-radius: var(--radius-pill); border: 1px solid var(--glass-border-hover); background: var(--glass-bg); color: var(--text-secondary);
  box-shadow: var(--glass-specular); font-size: 12px; font-weight: 600; user-select: none;
  transition: background .2s, color .2s, transform .35s var(--spring);
}
.more-fold > summary::-webkit-details-marker { display: none; }
.more-fold > summary:hover { background: var(--glass-bg-hover); color: var(--text-primary); transform: translateY(-1px); }
.more-fold > summary:active { transform: translateY(1px) scale(0.97); transition-duration: .08s; }
.more-fold > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.more-fold > summary .plus-v { transform-box: view-box; transform-origin: 12px 12px; transition: transform .25s; } /* the plus turns into a minus */
.more-fold[open] > summary .plus-v { transform: scaleY(0); }
.more-fold .more-open, .more-fold[open] .more-closed { display: none; }
.more-fold[open] .more-open { display: inline; }
.more-fold > .kv { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { .more-fold > summary, .more-fold .plus-v { transition: none; } }

/* ---- Save Filters and Load Filters, a row of their own above the search box ---- */
.toolbar .filters-io { flex: 1 0 100%; display: flex; gap: 8px; }
