/* Decipher concept — accent C (blue). Lab notebook, alive. */
:root { --accent: var(--C); --accent-text: var(--C-text); --accent-soft: var(--C-soft); --accent-btn: var(--C-btn); --accent-on: var(--C-on);
  --top-h: 60px; --tab-h: 0px; --hair: color-mix(in srgb, var(--ink) 11%, transparent); --noise: color-mix(in srgb, var(--ink) 13%, transparent);
  /* light theme only (the dark tokens win on specificity): shared --ink-3 is 4.42:1 on paper, just under AA */
  --ink-3: #61675f; }
/* genotype tiles: white letters need the deeper A and T to clear AA (shared .base uses --A / --T) */
.base[data-b="A"] { background: var(--A-btn); } .base[data-b="T"] { background: var(--T-text); }
.nowrap { white-space: nowrap; }
body { display: flex; flex-direction: column; padding-bottom: var(--tab-h); }
main { flex: 1; outline: none; }
main:focus { outline: none; }
.ic { width: 18px; height: 18px; flex: none; }
.ic-sm { width: 16px; height: 16px; } .ic-xs { width: 13px; height: 13px; }
.linkish { color: var(--accent-text); font-weight: 600; font-size: var(--t-sm); display: inline-flex; align-items: center; gap: 4px; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; padding: 4px 0; }
.linkish:hover { text-decoration-color: currentColor; }
.hint { font-size: var(--t-xs); color: var(--ink-3); line-height: 1.5; }
.faint { color: var(--ink-3); }
.boot { padding: 80px var(--gutter); display: grid; gap: 10px; justify-items: start; }
.boot-h { font-family: var(--font-display); font-size: clamp(30px, 4vw, 44px); line-height: 1.05; }
.boot-p { color: var(--ink-2); font-size: var(--t-sm); margin-bottom: 6px; }

/* ── top bar ───────────────────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1440px; margin: 0 auto; height: var(--top-h); padding: 0 var(--gutter); display: flex; align-items: center; gap: 20px; }
.topbar .wordmark b { font-size: 23px; }
.nav { display: flex; gap: 2px; margin-left: 10px; }
.nav a { position: relative; padding: 8px 12px; border-radius: var(--r-sm); text-decoration: none; font-size: var(--t-sm); font-weight: 500; color: var(--ink-2); }
.nav a:hover { color: var(--ink); background: var(--accent-soft); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -11px; height: 2px; background: var(--accent); border-radius: 2px; }
.topbar-flags { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.demo-chip { font-size: var(--t-2xs); font-family: var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--accent-text); background: var(--accent-soft); border-radius: var(--r-pill); padding: 4px 10px; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.jump { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); color: var(--ink-3); font-size: var(--t-sm); }
.jump:hover { border-color: var(--ink-3); color: var(--ink); }
.jump .ic { width: 15px; height: 15px; }
.jump kbd { border-bottom-width: 1px; }

.nav a { white-space: nowrap; }
@media (max-width: 1240px) {
  .dc-x { display: none; }
  .jump-text, .jump kbd { display: none; }
  .jump { width: 36px; padding: 0; justify-content: center; }
  .topbar-in { gap: 14px; }
  .nav { margin-left: 0; }
}

/* ── tab bar (phones / tablets) ────────────────────────────────────────── */
.tabbar { display: none; }
@media (max-width: 1000px) {
  :root { --tab-h: calc(62px + env(safe-area-inset-bottom)); }
  .nav, .jump-text, .jump kbd { display: none; }
  .jump { width: 36px; padding: 0; justify-content: center; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; height: var(--tab-h); padding-bottom: env(safe-area-inset-bottom); background: var(--paper); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--ink-3); font-size: var(--t-2xs); font-weight: 500; min-height: 48px; }
  .tabbar a .ic { width: 21px; height: 21px; }
  .tabbar a[aria-current="page"] { color: var(--accent-text); }
  .tabbar a[aria-current="page"] .ic { stroke-width: 2.1; }
  .toast-host { bottom: calc(var(--tab-h) + 12px); }
}
@media (max-width: 640px) {
  :root { --top-h: auto; }
  .topbar { position: relative; }
  .topbar-in { flex-wrap: wrap; row-gap: 0; padding-top: 10px; padding-bottom: 8px; gap: 10px; }
  .topbar .wordmark b { font-size: 21px; }
  .topbar-actions { margin-left: auto; order: 2; }
  .topbar-flags { order: 3; width: 100%; margin: 6px 0 0; justify-content: flex-start; }
  .signin { padding: 0 10px; }
}
@media (max-width: 420px) { .dc-x { display: none; } }
@media (max-width: 380px) { .topbar .wordmark small { display: none; } }

/* ── footer ───────────────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); margin-top: 72px; color: var(--ink-3); font-size: var(--t-xs); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 32px; padding-top: 22px; padding-bottom: 26px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.foot-links a, .foot-links .linkish { color: var(--ink-2); font-weight: 500; font-size: var(--t-xs); }

/* ── page heads ───────────────────────────────────────────────────────── */
.page-head { padding: 44px 0 28px; }
.page-head .label { display: block; margin-bottom: 12px; }
.page-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(40px, 5.2vw, 66px); line-height: 1; letter-spacing: -.02em; }
.page-title em { font-style: italic; color: var(--accent-text); }
.page-head .lede { margin-top: 14px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.eyebrow .label { margin: 0; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--A); box-shadow: 0 0 0 3px var(--A-soft); }
.row-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.h2 em { font-style: italic; color: var(--accent-text); }

/* ── Ask ──────────────────────────────────────────────────────────────── */
.ask { position: relative; }
.ask > .wrap { position: relative; }
.ask::before { content: ''; position: absolute; inset: 0 0 auto; height: 620px; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px; background-position: -1px -1px; -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent); }
.ask-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.composer { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.intents { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); background: var(--card-2); }
.intent { position: relative; text-align: left; padding: 14px 16px 15px; display: grid; gap: 1px; border-right: 1px solid var(--line); color: var(--ink-2); min-height: 72px; transition: background var(--dur) var(--ease), color var(--dur); }
.intent:last-child { border-right: 0; }
.intent:hover { background: var(--card); color: var(--ink); }
.intent-n { font-size: var(--t-2xs); color: var(--ink-3); letter-spacing: .06em; }
.intent-t { font-weight: 600; font-size: var(--t-sm); color: inherit; }
.intent-s { font-size: var(--t-xs); color: var(--ink-3); line-height: 1.35; }
.intent[aria-checked="true"] { background: var(--card); color: var(--ink); }
.intent[aria-checked="true"]::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent); }
.intent[aria-checked="true"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--card); }
.intent[aria-checked="true"] .intent-n { color: var(--accent-text); }
.sentence-wrap { padding: 44px 40px 10px; container-type: inline-size; }
.sentence { font-family: var(--font-display); font-size: clamp(28px, 5.4cqi, 42px); line-height: 1.52; letter-spacing: -.012em; color: var(--ink); text-wrap: pretty; }
.slot-q { display: inline-block; max-width: 100%; margin: .12em 0 .2em; }
.sentence .fixed { font-style: italic; }
.slot { position: relative; display: inline; text-align: left; font: inherit; letter-spacing: inherit; line-height: inherit; color: var(--accent-text); padding: 0 .06em; border-radius: 4px;
  text-decoration: underline; text-decoration-style: dashed; text-decoration-thickness: 2px; text-underline-offset: .16em; text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background var(--dur), text-decoration-color var(--dur); }
.slot:hover, .slot[aria-expanded="true"] { background: var(--accent-soft); text-decoration-color: var(--accent); text-decoration-style: solid; }
.slot-hint { position: absolute; left: .06em; top: -.7em; font-family: var(--font-mono); font-size: 10px; line-height: 1; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; pointer-events: none; font-style: normal; }
.slot-q .slot-val { font-style: italic; }
.slot.is-empty { color: var(--ink-3); font-style: italic; }
.slot-rs { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0; color: var(--ink-3); margin-left: .35em; vertical-align: .55em; text-decoration: none; display: inline-block; }
.detail { padding: 6px 40px 0; display: grid; gap: 14px; }
.detail:empty { display: none; }
.mk-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: var(--t-sm); color: var(--ink-2); padding: 12px 0 2px; border-top: 1px dashed var(--line); }
.mk-id { font-size: var(--t-xs); color: var(--ink); background: var(--paper-2); border-radius: var(--r-xs); padding: 3px 8px; }
.mk-count { display: inline-flex; align-items: center; gap: 6px; }
.allele-btn { display: inline-flex; align-items: center; gap: 3px; padding: 2px 4px 2px 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink-3); }
.allele-btn:hover { border-color: var(--ink-3); }
.allele-btn .base { font-size: 13px; }
.mk-meaning { color: var(--ink-3); font-size: var(--t-xs); flex-basis: 100%; }
.q-card { background: var(--card-2); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 14px 16px; }
.q-empty { border-style: dashed; }
.q-empty .q-prompt { color: var(--ink-2); font-size: var(--t-sm); font-weight: 400; }
.q-empty .q-opts .btn { margin-left: 0; }
.rep-line { color: var(--ink); }
.rep-line .ic { color: var(--accent-text) !important; }
.rep-line .linkish { padding: 0; font-size: inherit; }
.note-line .linkish { padding: 0; font-size: inherit; }
.q-prompt { font-size: var(--t-md); font-weight: 500; margin: 4px 0 10px; }
.q-opts, .rv-opts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.q-opt { display: inline-flex; align-items: center; height: 28px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); font-size: var(--t-xs); color: var(--ink-2); }
.q-opts .btn { margin-left: auto; }
.note-line { display: flex; gap: 8px; align-items: flex-start; font-size: var(--t-sm); color: var(--ink-2); padding: 12px 0 0; border-top: 1px dashed var(--line); }
.note-line .ic { margin-top: 2px; color: var(--ink-3); }
.adv { margin: 26px 40px 0; border-top: 1px solid var(--line); }
.adv summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 0; cursor: pointer; }
.adv summary::-webkit-details-marker { display: none; }
.adv-t { font-weight: 600; font-size: var(--t-sm); }
.adv-s { font-size: var(--t-xs); color: var(--ink-3); flex: 1; }
.adv-chev { color: var(--ink-3); transition: transform var(--dur) var(--ease); }
.adv[open] .adv-chev { transform: rotate(180deg); }
.adv-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 18px; padding: 4px 0 18px; }
.adv-grid > * { min-width: 0; }
.field input { min-width: 0; }
.nocase { text-transform: none; }
.fld { display: grid; gap: 6px; align-content: start; }
.fld .label { color: var(--ink-3); }
.fld-wide { grid-column: 1 / -1; }
.field .unit { font-size: var(--t-xs); color: var(--ink-3); white-space: nowrap; }
.field-sm { height: 34px; }
.field-sm input, .field-sm select { font-size: var(--t-sm); }
.field select { width: 100%; min-width: 0; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; appearance: none; -webkit-appearance: none; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237e8680' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 2px center / 14px; padding-right: 22px; cursor: pointer; }
.range-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.range-row input { flex: 1 1 160px; accent-color: var(--accent); min-width: 0; }
.range-row output { font-size: var(--t-xs); color: var(--ink-2); white-space: nowrap; }
.composer-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 18px 40px 26px; border-top: 1px solid var(--line); margin-top: 0; background: var(--card-2); }
.adv + .composer-foot { margin-top: 0; }
.composer-foot .btn-primary.is-blocked { opacity: .55; }
.foot-hint { font-size: var(--t-xs); color: var(--ink-3); }
.foot-sum { display: none; }
@media (max-width: 1060px) {
  .foot-sum { display: flex; flex-wrap: wrap; gap: 4px 14px; flex-basis: 100%; font-family: var(--font-mono); font-size: var(--t-2xs); color: var(--ink-3); padding-bottom: 4px; }
  .foot-sum b { color: var(--ink); font-weight: 500; }
}

/* before anyone answers: the participant's view */
.before { margin: 22px 40px 0; padding-top: 18px; border-top: 1px dashed var(--line); }
.before-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 14px; }
.before-head .label { font-size: var(--t-2xs); }
.before-sub { font-size: var(--t-xs); color: var(--ink-3); }
.before-grid { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 18px 28px; align-items: start; }
.pc { display: grid; gap: 9px; padding: 14px 16px 16px; background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--A); border-radius: 14px; }
.pc-from { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--A-text); }
.pc-q { font-family: var(--font-display); font-size: 21px; line-height: 1.2; color: var(--ink); overflow-wrap: anywhere; }
.pc-opts { display: flex; flex-wrap: wrap; gap: 5px; }
.pc-opt { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); font-size: var(--t-2xs); color: var(--ink-2); }
.pc-l { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-top: 2px; }
.pc-sends { list-style: none; display: grid; gap: 5px; }
.pc-sends li { display: flex; gap: 7px; align-items: flex-start; font-size: var(--t-xs); line-height: 1.4; color: var(--ink); }
.pc-sends li.meta { color: var(--ink-3); }
.pc-sends .ic { margin-top: 2px; color: var(--A-text); }
.pc-sends li.meta .ic { color: var(--ink-3); }
.pc-sends .mono { font-size: .95em; }
.pc-lv { display: flex; align-items: center; gap: 7px; font-size: var(--t-2xs); color: var(--ink-2); padding-top: 9px; border-top: 1px solid var(--line-2); }
.pc-btns { display: flex; gap: 6px; }
.pc-b { flex: 1; display: inline-grid; place-items: center; height: 32px; border-radius: 8px; border: 1px solid var(--line); font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); background: var(--card); }
.pc-b.pc-yes { background: var(--A-btn); border-color: var(--A-btn); color: var(--A-on); }
.before-notes { list-style: none; display: grid; gap: 12px; padding-top: 2px; }
.before-notes li { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.5; padding-left: 16px; position: relative; }
.before-notes li::before { content: ''; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 2px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.before-notes b { color: var(--ink); font-weight: 600; }

/* live preview: an instrument panel */
.preview { position: sticky; top: calc(var(--top-h) + 16px); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.pv-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--card-2); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.pv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pv { padding: 16px 18px 18px; border-bottom: 1px solid var(--line-2); }
.pv:last-child { border-bottom: 0; }
.pv-l { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-weight: 500; font-size: var(--t-2xs); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.pv-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 8px; }
.pv-big b { font-family: var(--font-mono); font-weight: 500; font-size: 30px; letter-spacing: -.03em; line-height: 1.05; color: var(--ink); }
.pv-big span { font-size: var(--t-xs); color: var(--ink-3); }
.pv-text { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.5; }
.pv-text b { color: var(--ink); font-weight: 600; }
.pv-note { font-size: var(--t-xs); color: var(--ink-3); margin-top: 8px; line-height: 1.5; }
.pv-note b { color: var(--ink-2); font-weight: 600; }
.pv-warn { display: flex; gap: 6px; font-size: var(--t-xs); color: var(--risk); margin-bottom: 8px; }
.pv .linkish { margin-top: 6px; }
.pv-lv { display: flex; align-items: center; gap: 8px; font-size: var(--t-sm); margin-top: 10px; }
.pv-reasons { list-style: none; margin-top: 8px; display: grid; gap: 4px; }
.pv-reasons li { font-size: var(--t-xs); color: var(--ink-2); padding-left: 14px; position: relative; }
.pv-reasons li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 5px; height: 1px; background: var(--ink-3); }
.anc-bars { list-style: none; display: grid; gap: 5px; margin-top: 4px; }
.anc-bars li { display: grid; grid-template-columns: minmax(0, 1fr) 96px 30px; align-items: center; gap: 10px; font-size: var(--t-xs); color: var(--ink-3); }
.anc-bars li.is-on { color: var(--ink-2); }
.ab-bar { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; display: block; }
.ab-bar > span { display: block; height: 100%; background: var(--ink-3); opacity: .45; border-radius: 3px; }
.anc-bars li.is-on .ab-bar > span { background: var(--accent); opacity: 1; }
.ab-bar > .ab-hatch { display: block; height: 100%; width: 100%; background: repeating-linear-gradient(-45deg, var(--line) 0 2px, transparent 2px 5px); opacity: 1 !important; }
.ab-n { text-align: right; font-family: var(--font-mono); font-size: var(--t-2xs); }
.split { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-top: 12px; background: var(--line-2); }
.split-s { background: var(--ink-2); }
.split-n { background: repeating-linear-gradient(-45deg, var(--accent-soft) 0 3px, color-mix(in srgb, var(--accent) 30%, transparent) 3px 5px); }
.split-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: var(--t-2xs); color: var(--ink-3); font-family: var(--font-mono); }
.split-key i, .fig-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.k-samp { background: var(--ink-2); }
.k-noise { background: repeating-linear-gradient(-45deg, var(--accent-soft) 0 2px, color-mix(in srgb, var(--accent) 30%, transparent) 2px 4px); }
.lv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lv-btns { display: flex; gap: 4px; }
.lv-strip { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; flex: 1; max-width: 220px; }
.lv-cell { height: 24px; border-radius: 4px; background: var(--line-2); display: grid; place-items: center; }
.lv-cell i { font-style: normal; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
.lv-cell.on { background: color-mix(in srgb, var(--lvc) 26%, transparent); }
.lv-cell.on i { color: var(--ink); }
.lv-cell.cur { background: var(--lvc); box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--lvc); }
.lv-cell.cur i { color: #fff; font-weight: 500; }
.lv-0, .lv-1, .lv-c-0, .lv-c-1 { --lvc: var(--A); } .lv-2, .lv-3, .lv-c-2, .lv-c-3 { --lvc: var(--C); }
.lv-4, .lv-5, .lv-c-4, .lv-c-5 { --lvc: var(--G); } .lv-6, .lv-7, .lv-c-6, .lv-c-7 { --lvc: var(--T); }
.lv-cell.cur.lv-4 i, .lv-cell.cur.lv-5 i { color: #1a1300; }
:root[data-theme="dark"] .lv-cell.cur i { color: #06100a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lv-cell.cur i { color: #06100a; } }
.tpl-lv { font-family: var(--font-mono); font-size: var(--t-2xs); font-weight: 500; padding: 2px 6px; border-radius: 4px; color: var(--ink); background: color-mix(in srgb, var(--lvc) 18%, transparent); border: 1px solid color-mix(in srgb, var(--lvc) 45%, transparent); flex: none; }

/* templates */
.templates { margin-top: 64px; padding: 48px 0 8px; border-top: 1px solid var(--line); background: var(--paper-2); }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 22px; }
.sec-head .muted { font-size: var(--t-sm); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; padding-bottom: 32px; }
.tpl { display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 16px 16px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); transition: border-color var(--dur), box-shadow var(--dur); min-height: 172px; }
.tpl:hover { border-color: var(--ink-3); box-shadow: 0 0 0 4px var(--accent-soft); }
.tpl-top { display: flex; justify-content: space-between; align-items: center; }
.tpl-title { font-weight: 600; font-size: var(--t-sm); color: var(--ink); }
.tpl-q { font-family: var(--font-display); font-size: 19px; line-height: 1.25; color: var(--ink-2); flex: 1; }
.tpl-meta { font-size: var(--t-2xs); color: var(--ink-3); letter-spacing: .02em; }

/* ── popovers ─────────────────────────────────────────────────────────── */
.pop-wrap { position: fixed; inset: 0; z-index: 700; pointer-events: none; }
.pop { position: fixed; pointer-events: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: 12px; max-height: min(520px, calc(100vh - 24px)); overflow: auto; animation: pop-in .16s var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
.pop-phone { pointer-events: auto; }
.pop-phone .sheet-scrim { position: absolute; inset: 0; background: var(--overlay); }
.pop-phone .pop { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto !important; border-radius: 16px 16px 0 0; max-height: 82vh; padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); animation: sheet-up .2s var(--ease); }
@keyframes sheet-up { from { transform: translateY(24px); opacity: .4; } }
.pop-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 8px; }
.combo { display: grid; gap: 8px; }
.combo-list { list-style: none; display: grid; gap: 2px; max-height: 330px; overflow: auto; }
.combo-opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer; }
.combo-opt[aria-selected="true"], .combo-opt:hover { background: var(--accent-soft); }
.co-main { display: grid; gap: 1px; min-width: 0; flex: 1; }
.co-main b { font-weight: 600; font-size: var(--t-sm); }
.co-main .mono { font-size: var(--t-2xs); color: var(--ink-3); }
.co-m { font-size: var(--t-xs); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-empty { padding: 12px 10px; font-size: var(--t-sm); color: var(--ink-3); }
.co-cur { margin-left: 8px; font-family: var(--font-mono); font-size: var(--t-2xs); font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-text); }
.co-check { color: var(--accent-text); }
.combo-opt.is-current { border-bottom: 1px solid var(--line-2); border-radius: var(--r-sm) var(--r-sm) 0 0; margin-bottom: 2px; }
.combo-foot { display: flex; justify-content: space-between; gap: 8px; font-size: var(--t-2xs); color: var(--ink-3); font-family: var(--font-mono); padding: 6px 4px 0; border-top: 1px solid var(--line-2); }
.who-pop, .q-pop, .allele-pop { display: grid; gap: 10px; padding: 4px; }
.who-pop .label, .q-pop .label, .allele-pop .label { margin-top: 2px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 32px; font-size: var(--t-xs); }
.chip .mono { font-size: var(--t-2xs); opacity: .75; }
.chip-off { border-style: dashed; color: var(--ink-3); background: transparent; }
.seg { display: inline-grid; grid-auto-flow: column; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; justify-self: start; }
.seg button { height: 34px; padding: 0 14px; font-size: var(--t-xs); font-weight: 500; color: var(--ink-2); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.who-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: var(--t-sm); color: var(--ink-2); }
.who-foot b { font-family: var(--font-mono); font-weight: 500; color: var(--ink); }
.q-pop textarea, .ta { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); padding: 10px 12px; font-size: var(--t-md); line-height: 1.45; outline: none; }
.q-pop textarea:focus, .ta:focus { border-color: var(--ink-3); box-shadow: 0 0 0 4px var(--accent-soft); }
.opt-list { list-style: none; display: grid; gap: 6px; }
.opt-list li { display: flex; gap: 6px; align-items: center; }
.opt-list .field { flex: 1; }
.q-pop-foot { display: flex; justify-content: space-between; gap: 8px; }
.allele-row { display: flex; gap: 8px; }
.allele-opt { padding: 4px; border-radius: 8px; border: 1px solid transparent; }
.allele-opt .base { font-size: 18px; }
.allele-opt[aria-pressed="true"] { border-color: var(--ink); }
.menu { display: grid; gap: 2px; }
.menu-item { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px; border-radius: var(--r-sm); }
.menu-item:hover { background: var(--accent-soft); }
.menu-item span { display: grid; gap: 1px; } .menu-item b { font-size: var(--t-sm); font-weight: 600; } .menu-item small { font-size: var(--t-xs); color: var(--ink-3); }
.menu-item .ic { margin-top: 2px; color: var(--ink-3); }

/* ── sheets ───────────────────────────────────────────────────────────── */
body.has-sheet { overflow: hidden; }
.sheet-wrap { position: fixed; inset: 0; z-index: 800; }
.sheet-scrim { position: absolute; inset: 0; background: var(--overlay); opacity: 0; transition: opacity .2s var(--ease); }
.sheet { position: absolute; background: var(--card); box-shadow: var(--shadow-2); outline: none; display: flex; flex-direction: column; opacity: 0; transition: opacity .2s var(--ease), transform .2s var(--ease); }
.sheet-wrap.is-open .sheet-scrim { opacity: 1; } .sheet-wrap.is-open .sheet { opacity: 1; transform: none; }
.sheet-wrap.is-closing .sheet-scrim, .sheet-wrap.is-closing .sheet { opacity: 0; }
.sheet-side .sheet { top: 0; right: 0; bottom: 0; width: min(560px, 100vw); border-left: 1px solid var(--line); transform: translateX(28px); }
.sheet-side .sheet-lg { width: min(860px, 100vw); }
.sheet-side .sheet-sm { width: min(440px, 100vw); }
.sheet-center .sheet { left: 50%; top: 50%; width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 40px); transform: translate(-50%, -46%); border: 1px solid var(--line); border-radius: var(--r-lg); }
.sheet-wrap.is-open.sheet-center .sheet { transform: translate(-50%, -50%); }
.sheet-palette .sheet { left: 50%; top: 12vh; width: min(620px, calc(100vw - 24px)); max-height: 70vh; transform: translate(-50%, -6px); border: 1px solid var(--line); border-radius: 14px; }
.sheet-wrap.is-open.sheet-palette .sheet { transform: translate(-50%, 0); }
.sheet-palette .sheet-x { display: none; }
.sheet-body { overflow: auto; padding: 30px 32px 0; flex: 1; overscroll-behavior: contain; }
.sheet-palette .sheet-body { padding: 10px; }
.sheet-center .sheet-body { padding-bottom: 28px; }
.sheet-x { position: absolute; top: 14px; right: 14px; z-index: 2; }
.sh-head { padding-right: 40px; margin-bottom: 18px; }
.sh-head .label { display: block; margin-bottom: 8px; }
.sh-title { font-family: var(--font-display); font-weight: 400; font-size: 36px; line-height: 1.05; letter-spacing: -.01em; outline: none; }
.sh-sec { padding: 20px 0; border-top: 1px solid var(--line-2); }
.sh-h { display: flex; align-items: center; gap: 8px; font-size: var(--t-md); font-weight: 600; margin-bottom: 10px; }
.sh-p { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.55; }
.sh-p .ic { vertical-align: -3px; margin-right: 4px; color: var(--ok); }
.sh-foot { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 0 22px; margin-top: 8px; background: var(--card); border-top: 1px solid var(--line); }
.sh-foot .foot-hint { flex-basis: 100%; }
.sh-actions { margin-top: 12px; }
.btn.wide { width: 100%; margin: 14px 0 10px; }
.rv-q { font-family: var(--font-display); font-size: 27px; line-height: 1.22; padding: 16px 18px; background: var(--card-2); border-left: 3px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; margin-bottom: 10px; }
.rv-opts { margin: 0 0 6px; }
.rv-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; padding: 16px 0 20px; }
.rv-facts dt, .facts-dl dt, .cite-dl dt, .g-dl dt { font-family: var(--font-mono); font-size: var(--t-2xs); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 3px; }
.rv-facts dd { font-size: var(--t-sm); }
.t-risk { color: var(--risk); font-weight: 600; }
.parts { list-style: none; display: grid; gap: 6px; margin-bottom: 12px; }
.parts li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--t-sm); padding: 9px 12px; background: var(--card-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); }
.parts li .ic { color: var(--accent-text); margin-top: 2px; }
.parts li.meta { color: var(--ink-2); } .parts li.meta .ic { color: var(--ink-3); }
.disclose { margin-top: 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 0 12px; }
.disclose summary { cursor: pointer; padding: 10px 0; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.disclose[open] summary { border-bottom: 1px solid var(--line-2); margin-bottom: 10px; }
.disclose > .sh-p, .disclose > .hint { padding-bottom: 12px; }
.code { font-family: var(--font-mono); font-size: 12px; line-height: 1.5; background: var(--paper-2); border-radius: var(--r-sm); padding: 12px; overflow: auto; max-height: 320px; margin-bottom: 10px; white-space: pre; }
.key-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.key-peek { font-size: var(--t-xs); background: var(--paper-2); padding: 6px 10px; border-radius: var(--r-xs); color: var(--ink-2); }
.key-state { display: inline-flex; gap: 4px; align-items: center; font-size: var(--t-xs); color: var(--ok); font-weight: 600; }
.checks { list-style: none; display: grid; gap: 8px; margin-top: 12px; }
.check { position: relative; display: flex; gap: 12px; align-items: flex-start; font-size: var(--t-sm); line-height: 1.5; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; color: var(--ink-2); transition: border-color var(--dur), background var(--dur); }
.check:hover { border-color: var(--ink-3); }
.check input { position: absolute; opacity: 0; width: 20px; height: 20px; left: 14px; top: 13px; margin: 0; }
.check .box { flex: none; width: 20px; height: 20px; border: 1.5px solid var(--ink-3); border-radius: 5px; display: grid; place-items: center; color: transparent; margin-top: 1px; background: var(--card); }
.check input:checked + .box { background: var(--accent-btn); border-color: var(--accent-btn); color: var(--accent-on); }
.check input:checked ~ span:last-child { color: var(--ink); }
.check:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--accent-soft); }
.check input:focus-visible + .box { outline: 2px solid var(--focus); outline-offset: 2px; }
.check a { color: var(--accent-text); }
.callout { display: flex; gap: 10px; align-items: flex-start; font-size: var(--t-sm); color: var(--ink-2); background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; margin: 6px 0 12px; }
.callout .ic { margin-top: 2px; color: var(--info); }
.callout-risk { background: var(--risk-soft); border-color: color-mix(in srgb, var(--T) 30%, transparent); color: var(--ink); }
.callout-risk .ic { color: var(--risk); }
.callout-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--G) 40%, transparent); color: var(--ink); }
.callout-warn .ic { color: var(--warn); }
.callout .linkish { padding: 0; font-size: inherit; }

/* palette */
.pal-field { height: 50px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none !important; }
.pal-field input { font-size: var(--t-lg); }
.pal-list { list-style: none; padding: 6px 0 4px; max-height: 52vh; overflow: auto; }
.pal-g { font-family: var(--font-mono); font-size: var(--t-2xs); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 12px 10px 4px; }
.pal-o { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: var(--t-sm); }
.pal-o .ic { color: var(--ink-3); }
.pal-o small { margin-left: auto; font-size: var(--t-2xs); color: var(--ink-3); font-family: var(--font-mono); }
.pal-o[aria-selected="true"], .pal-o:hover { background: var(--accent-soft); }
.pal-o[aria-selected="true"] .ic { color: var(--accent-text); }
.pal-empty { padding: 16px 10px; color: var(--ink-3); font-size: var(--t-sm); }

/* ── toast action ─────────────────────────────────────────────────────── */
.toast { display: flex; align-items: center; gap: 14px; max-width: min(520px, calc(100vw - 32px)); }
.toast-act { color: var(--paper); font-weight: 700; font-size: var(--t-sm); text-decoration: underline; text-underline-offset: 3px; padding: 4px; }

/* ── study: collecting ────────────────────────────────────────────────── */
.study { padding-top: 22px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--t-xs); color: var(--ink-3); margin-bottom: 18px; }
.crumbs a { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); text-decoration: none; font-weight: 500; padding: 6px 0; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.study-head { margin-bottom: 22px; }
.study-head .label { display: block; margin-bottom: 10px; }
.study-head .study-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(32px, 4vw, 48px); line-height: 1.05; letter-spacing: -.015em; }
.study-q { font-family: var(--font-display); font-style: italic; font-size: clamp(19px, 2vw, 24px); color: var(--ink-2); margin-top: 8px; line-height: 1.3; }
.stage { position: relative; display: flex; flex-direction: column; height: clamp(400px, 58vh, 560px); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background-color: var(--card);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; }
.stage-field { position: relative; flex: 1; min-height: 0; }
.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; justify-items: center; text-align: center; gap: 6px; width: min(300px, 70%); pointer-events: none; }
.stage-center::before { content: ''; position: absolute; inset: -24px -10px; z-index: -1; background: radial-gradient(circle closest-side, var(--card) 62%, color-mix(in srgb, var(--card) 70%, transparent) 80%, transparent); }
.stage-center .btn { pointer-events: auto; margin-top: 10px; }
.stage-big { font-family: var(--font-display); font-size: clamp(64px, 9vw, 104px); line-height: .9; letter-spacing: -.03em; display: flex; align-items: baseline; gap: 4px; }
.stage-big b { font-weight: 400; }
.stage-big span { font-family: var(--font-mono); font-size: 22px; color: var(--ink-3); letter-spacing: 0; }
.stage-sub { font-size: var(--t-sm); color: var(--ink-2); }
.stage-foot { position: relative; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line-2); background: color-mix(in srgb, var(--card) 88%, transparent); font-size: var(--t-xs); color: var(--ink-2); }
.collect-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin-top: 28px; }
.timeline { list-style: none; display: grid; gap: 0; }
.timeline li { position: relative; display: flex; gap: 14px; padding: 0 0 18px; }
.timeline li::before { content: ''; position: absolute; left: 10px; top: 22px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li > span:last-child { display: grid; gap: 1px; font-size: var(--t-sm); }
.timeline small { color: var(--ink-3); font-size: var(--t-xs); }
.tl-dot { flex: none; width: 21px; height: 21px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); display: grid; place-items: center; color: var(--accent-on); }
.timeline li.done .tl-dot { background: var(--accent-btn); border-color: var(--accent-btn); }
.timeline li.cur .tl-dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.facts { border-top: 1px solid var(--line); padding-top: 4px; }
.facts-dl { display: grid; gap: 0; }
.facts-dl > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.facts-dl > div:last-child { border-bottom: 0; }
.facts-dl dt { margin: 2px 0 0; }
.facts-dl dd { font-size: var(--t-sm); overflow-wrap: anywhere; }
.facts-dl dd.mono { font-size: var(--t-xs); }

/* ── study: result ────────────────────────────────────────────────────── */
.result-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 44px; align-items: start; }
.result-head .label { display: block; margin-bottom: 8px; }
.result-head .study-title { font-family: var(--font-ui); font-weight: 600; font-size: var(--t-md); color: var(--ink-2); letter-spacing: -.005em; line-height: 1.35; }
.answer { font-family: var(--font-display); font-size: clamp(28px, 3.1vw, 42px); line-height: 1.16; letter-spacing: -.012em; margin-top: 14px; text-wrap: pretty; }
.answer em { font-style: italic; color: var(--accent-text); white-space: nowrap; }
.answer-sub { font-size: var(--t-lg); color: var(--ink-2); margin-top: 12px; max-width: 62ch; }
.answer-act { margin-top: 14px; }
.outcome { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 22px; }
.outcome .label { margin-right: 6px; }
.fig { margin-top: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px 16px; }
.fig-2 { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 20px 34px; }
.fig-2 .fig-key { grid-column: 1 / -1; }
.fig-panel { min-width: 0; }
.fig-head { display: flex; align-items: center; gap: 10px; font-size: var(--t-sm); font-weight: 600; margin-bottom: 18px; }
.fig-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--ink); border-radius: 4px; font-family: var(--font-mono); font-size: var(--t-xs); font-weight: 500; flex: none; }
.vchart { position: relative; height: 230px; margin-left: 38px; }
.vc-grid { position: absolute; inset: 0; }
.vc-grid span { position: absolute; left: 0; right: 0; height: 1px; background: var(--line-2); }
.vc-grid span:first-child { background: var(--ink-3); }
.vc-grid i { position: absolute; right: calc(100% + 8px); top: -7px; font-style: normal; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
.vc-cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.vc-col { position: relative; }
.vc-bar { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: min(52%, 92px); background: color-mix(in srgb, var(--bar) 20%, transparent); border-top: 2px solid var(--bar); border-radius: 2px 2px 0 0; }
.ci-noise { position: absolute; left: 50%; width: 22px; transform: translateX(-50%); background: repeating-linear-gradient(-45deg, var(--noise) 0 2px, transparent 2px 4.5px); border: 1px solid var(--noise); border-radius: 3px; }
.ci-samp { position: absolute; left: 50%; width: 2px; transform: translateX(-50%); background: var(--ink); }
.ci-samp::before, .ci-samp::after { content: ''; position: absolute; left: -5px; width: 12px; height: 2px; background: var(--ink); }
.ci-samp::before { top: 0; } .ci-samp::after { bottom: 0; }
.ci-noise.h { top: 50%; left: auto; width: auto; height: 16px; transform: translateY(-50%); }
.ci-samp.h { top: 50%; left: auto; height: 2px; width: auto; transform: translateY(-50%); }
.ci-samp.h::before, .ci-samp.h::after { top: -5px; width: 2px; height: 12px; left: 0; bottom: auto; }
.ci-samp.h::after { left: auto; right: 0; }
.vc-trend { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.vc-trend polyline { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.vc-xs { display: grid; grid-template-columns: repeat(3, 1fr); margin: 12px 0 0 38px; }
.vc-x { display: grid; justify-items: center; gap: 4px; text-align: center; }
.vc-x > span:last-child { margin-top: -3px; }
.vc-x b { font-family: var(--font-mono); font-weight: 500; font-size: var(--t-md); }
.vc-x > span:not(.genotype) { font-size: var(--t-2xs); color: var(--ink-3); font-family: var(--font-mono); }
.base-x { background: var(--line); color: var(--ink-2); }
.base-x.base-eff { background: var(--accent); color: var(--accent-on); }
/* dot strip */
.strip { position: relative; }
.st-axis, .st-row, .st-col { display: grid; grid-template-columns: 130px minmax(0, 1fr) 60px; align-items: center; gap: 12px; }
.st-axis { height: 18px; margin-bottom: 4px; }
.st-axis .st-track { position: relative; height: 100%; }
.st-axis i { position: absolute; transform: translateX(-50%); font-style: normal; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); top: 0; }
.st-body { position: relative; }
.st-col { position: absolute; inset: 0; pointer-events: none; }
.st-col .st-track { position: relative; height: 100%; }
.st-range { position: absolute; top: 0; bottom: 0; background: var(--accent-soft); border-left: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); border-right: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); }
.st-mark { position: absolute; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--accent) 60%, transparent); }
.st-row { position: relative; min-height: 34px; border-bottom: 1px solid var(--line-2); }
.st-row:last-child { border-bottom: 0; }
.st-lab { font-size: var(--t-xs); color: var(--ink-2); display: grid; line-height: 1.25; }
.st-lab small { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
.st-main .st-lab { color: var(--ink); font-weight: 600; }
.st-track { position: relative; height: 34px; }
.st-track::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line-2); }
.st-dot { position: absolute; top: 50%; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); border: 1.5px solid var(--ink-2); background: var(--card); }
.st-dot.main { width: 12px; height: 12px; background: var(--dot); border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--ink); z-index: 2; }
.st-mix .st-dot { border-style: dashed; border-color: var(--accent-text); }
.st-hyp .st-dot { border-radius: 2px; transform: translate(-50%, -50%) rotate(45deg); width: 9px; height: 9px; border-color: var(--G-text); }
.st-strat .st-dot.ref { width: 12px; height: 12px; border-width: 2px; z-index: 1; }
.st-val { text-align: right; font-family: var(--font-mono); font-size: var(--t-xs); color: var(--ink-2); display: grid; line-height: 1.2; }
.st-val b { font-weight: 500; color: var(--ink); font-size: var(--t-sm); }
.st-val small { font-size: 10px; color: var(--ink-3); }
.strip-strat .st-axis, .strip-strat .st-row { grid-template-columns: 150px minmax(0, 1fr) 70px; }
.st-noisy .st-dot.main { background: var(--card); box-shadow: 0 0 0 1px var(--ink-3); border-color: var(--card); }
.st-noisy .ci-samp { opacity: .45; }
.st-noisy .st-val b, .st-noisy .st-lab { color: var(--ink-3); font-weight: 500; }
.st-none { display: flex; gap: 8px; align-items: flex-start; font-size: var(--t-xs); color: var(--ink-3); margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--r-sm); }
.st-none .ic { flex: none; margin-top: 1px; }
.fig-note { display: flex; align-items: center; gap: 6px; font-size: var(--t-xs); color: var(--ink-3); margin-top: 12px; }
.state-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border: 1px dashed var(--line); border-radius: var(--r-md); background: var(--card-2); }
.state-card > .ic { flex: none; width: 22px; height: 22px; color: var(--ink-3); margin-top: 2px; }
.state-card b { font-size: var(--t-md); font-weight: 600; }
.state-card p { font-size: var(--t-xs); color: var(--ink-3); margin-top: 10px; }
.state-groups { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 18px; margin-top: 10px; }
.state-groups li { display: flex; justify-content: space-between; gap: 8px; font-size: var(--t-sm); color: var(--ink-2); padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.state-groups .mono { font-size: var(--t-2xs); color: var(--ink-3); }
.fig-key { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--t-2xs); color: var(--ink-3); font-family: var(--font-mono); padding-top: 14px; margin-top: 16px; border-top: 1px solid var(--line-2); }
.fig-key .k-samp { width: 12px; height: 2px; vertical-align: 3px; background: var(--ink); }
.fig-key .k-noise { background: repeating-linear-gradient(-45deg, var(--noise) 0 2px, transparent 2px 4px); border: 1px solid var(--noise); }
.k-col { background: var(--accent-soft); border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); }
.k-trend { width: 16px !important; height: 0 !important; border-top: 1.5px dashed var(--ink-2); border-radius: 0 !important; vertical-align: 3px !important; }
.k-ref { border: 1.5px solid var(--ink-2); border-radius: 50% !important; }
.count-fig { display: grid; gap: 14px; }
.count-big { display: flex; align-items: baseline; gap: 10px; }
.count-big b { font-family: var(--font-display); font-weight: 400; font-size: 80px; line-height: 1; letter-spacing: -.03em; }
.count-big span { font-family: var(--font-mono); font-size: var(--t-lg); color: var(--ink-3); }
.count-big small { font-size: var(--t-sm); color: var(--ink-3); }
.hbar { overflow: visible; }
.hbar-off { position: absolute; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--ink-2); line-height: 1; }
.hbar-off.l { left: -14px; } .hbar-off.r { right: -14px; }
.hbar { position: relative; height: 22px; background: var(--line-2); border-radius: 4px; }
.hbar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 24%, transparent); border-right: 2px solid var(--accent); border-radius: 4px 0 0 4px; }
.hbar-scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
.stat-line { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); }
.stat-line > div { padding: 14px 18px; }
.stat-line > div + div { border-left: 1px solid var(--line); }
.stat-line dt { font-family: var(--font-mono); font-size: var(--t-2xs); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.stat-line dd { display: grid; gap: 2px; margin-top: 6px; }
.stat-line dd b { font-family: var(--font-mono); font-weight: 500; font-size: 22px; letter-spacing: -.02em; margin-bottom: 4px; }
.stat-line dd b.is-open { font-family: var(--font-display); font-weight: 400; font-size: 26px; letter-spacing: -.01em; color: var(--ink-2); }
.stat-line dd > span { font-size: var(--t-xs); color: var(--ink-3); }
.sl-row { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 8px; font-size: var(--t-xs); color: var(--ink-2); padding: 3px 0; border-top: 1px dashed var(--line-2); }
.sl-row i { font-style: normal; color: var(--ink-3); }
.sl-row > span { font-family: var(--font-mono); }
.caption { font-size: var(--t-xs); color: var(--ink-3); line-height: 1.6; margin-top: 14px; max-width: 86ch; }
.caption b { color: var(--ink-2); font-weight: 600; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.result-side { display: grid; gap: 0; padding-top: 6px; }
.side-card { padding: 18px 0; border-top: 1px solid var(--line); }
.side-card:first-child { border-top: 2px solid var(--ink); }
.side-h { font-family: var(--font-mono); font-weight: 500; font-size: var(--t-2xs); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.side-p { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.5; margin-top: 8px; }
.side-p b { color: var(--ink); }
.side-q { font-family: var(--font-display); font-size: 21px; line-height: 1.25; margin-bottom: 10px; }
.side-status { display: flex; align-items: center; gap: 8px; font-size: var(--t-sm); font-weight: 500; }
.side-status b { font-family: var(--font-mono); font-weight: 500; }
.side-card .btn { margin-top: 12px; }
.side-card .facts-dl > div { grid-template-columns: 104px minmax(0, 1fr); }
.side-hyp { font-size: var(--t-sm); color: var(--ink-2); margin-top: 12px; display: grid; gap: 4px; font-style: italic; }
.side-hyp .label { font-style: normal; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-3); }
.status-dot.ok { background: var(--A); } .status-dot.live { background: var(--C); box-shadow: 0 0 0 3px var(--C-soft); } .status-dot.risk { background: var(--T); }
.mini-ring { width: 22px; height: 22px; flex: none; }
.mr-track { fill: none; stroke: var(--line); stroke-width: 3; }
.mr-fill { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.bm { position: relative; display: flex; height: 10px; border-radius: 3px; background: var(--line-2); overflow: hidden; margin-top: 10px; }
.bm-seg { height: 100%; background: var(--accent); }
.bm-seg.meta { background: repeating-linear-gradient(-45deg, var(--ink-3) 0 2px, color-mix(in srgb, var(--ink-3) 55%, transparent) 2px 4px); }
.bm i { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--card); }
.bm-scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); margin-top: 5px; }
.bm-legend { list-style: none; display: grid; gap: 6px; margin-top: 10px; }
.bm-legend li { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; font-size: var(--t-xs); color: var(--ink-2); }
.bm-legend i { width: 12px; height: 8px; border-radius: 2px; }
.bm-legend i.own { background: var(--accent); }
.bm-legend i.meta { background: repeating-linear-gradient(-45deg, var(--ink-3) 0 2px, color-mix(in srgb, var(--ink-3) 55%, transparent) 2px 4px); }
.bm-legend b { font-family: var(--font-mono); font-weight: 500; }

/* check / cite / tell */
.ck { padding: 18px 0; border-top: 1px solid var(--line-2); display: grid; gap: 8px; }
.ck-h { font-size: var(--t-md); font-weight: 600; }
.ck > p { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.55; }
.ck .tag { justify-self: start; }
.ck-note { font-size: var(--t-xs) !important; color: var(--ink-3) !important; }
.ck-rows { list-style: none; display: grid; }
.ck-rows li { display: grid; grid-template-columns: minmax(0, 1fr) 48px 64px auto; gap: 10px; align-items: center; font-size: var(--t-sm); padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.ck-rows .mono { font-size: var(--t-xs); color: var(--ink-2); text-align: right; }
.ck-rows li.is-open > span:first-child { color: var(--ink-2); }
.ck-proj { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ck-proj li { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--t-xs); color: var(--ink-3); }
.ck-proj b { font-family: var(--font-mono); font-weight: 500; font-size: var(--t-lg); color: var(--ink); }
.ck-proj .mono { color: var(--ink); }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); text-align: right; }
.tbl th:first-child { text-align: left; }
.tbl thead th { font-family: var(--font-mono); font-size: var(--t-2xs); font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.tbl td { font-family: var(--font-mono); }
.cite-dl { display: grid; }
.cite-dl > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.cite-dl dd { font-size: var(--t-sm); }
.wrap-any { overflow-wrap: anywhere; font-size: var(--t-xs) !important; }
.cite-line { margin: 20px 0 14px; padding: 16px; background: var(--paper-2); border-radius: var(--r-md); display: grid; gap: 12px; }
.cite-line p { font-family: var(--font-ui); font-size: 15px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.cite-line .btn { justify-self: start; }
.tell-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; padding-bottom: 28px; }
.tp-phone { display: grid; gap: 10px; align-content: start; }
.tp-card { border: 1px solid var(--line); border-top: 3px solid var(--A); border-radius: 14px; padding: 16px; background: var(--paper); display: grid; gap: 8px; }
.tp-from { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; color: var(--A-text); }
.tp-ticks { display: grid; grid-template-columns: repeat(2, 5px); gap: 1.5px; }
.tp-ticks i { width: 5px; height: 5px; border-radius: 1px; }
.tp-ticks i:nth-child(1) { background: var(--A); } .tp-ticks i:nth-child(2) { background: var(--C); } .tp-ticks i:nth-child(3) { background: var(--G); } .tp-ticks i:nth-child(4) { background: var(--T); }
.tp-title { font-family: var(--font-display); font-size: 22px; line-height: 1.15; }
.tp-body { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.tp-chart { padding: 8px 0 4px; border-top: 1px solid var(--line-2); }
.tp-ch { font-size: 11px; color: var(--ink-3); margin-bottom: 6px; }
.tp-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
.tp-col { display: grid; justify-items: center; gap: 4px; min-width: 0; }
.tp-v { font-family: var(--font-mono); font-size: 11px; color: var(--ink); }
.tp-bar { position: relative; width: 100%; max-width: 46px; height: 56px; border-bottom: 1px solid var(--line); }
.tp-bar i { position: absolute; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--A) 30%, transparent); border-top: 2px solid var(--A); border-radius: 2px 2px 0 0; }
.tp-col .genotype .base { width: 15px; height: 15px; font-size: 9px; }
.tp-l { font-size: 10px; color: var(--ink-3); text-align: center; line-height: 1.2; overflow-wrap: anywhere; }
.tp-foot { font-size: 11px; color: var(--ink-3); }

/* ── studies list ─────────────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.study-list { list-style: none; border-top: 2px solid var(--ink); }
.srow { display: grid; grid-template-columns: 116px minmax(0, 1fr) 108px 130px 110px 20px; gap: 18px; align-items: center; padding: 20px 6px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; transition: background var(--dur); }
.srow:hover { background: var(--card); }
.srow:hover .sr-go { color: var(--ink); transform: translateX(2px); }
.sr-status { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); }
.sr-main { display: grid; gap: 4px; min-width: 0; }
.sr-main b { font-weight: 600; font-size: var(--t-md); }
.sr-q { font-family: var(--font-display); font-size: 18px; color: var(--ink-2); line-height: 1.3; }
.sr-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.sr-col { display: grid; gap: 2px; align-content: start; }
.sr-col .label { font-size: 10px; }
.sr-col b { font-family: var(--font-mono); font-weight: 500; font-size: var(--t-lg); }
.sr-col small { font-size: var(--t-2xs); color: var(--ink-3); font-family: var(--font-mono); }
.sr-col .bm { height: 5px; margin-top: 4px; max-width: 110px; }
.sr-n { display: flex; align-items: center; gap: 6px; }
.sr-go { color: var(--ink-3); transition: transform var(--dur), color var(--dur); }
.net-line { margin-top: 26px; font-size: var(--t-xs); color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.empty { padding: 48px 24px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r-lg); display: grid; gap: 10px; justify-items: center; background: var(--card); }
.empty .row { flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.empty-page { padding: 72px var(--gutter) 40px; display: grid; gap: 18px; }

/* compare */
.compare { padding-top: 22px; }
.compare .page-head { padding-top: 8px; }
.empty .hint .linkish { font-size: inherit; padding: 0; }
.pick-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 22px; max-width: 900px; }
.pick-row .fld { min-width: 0; }
.privacy-line { display: flex; gap: 8px; align-items: flex-start; font-size: var(--t-sm); color: var(--ink-2); margin-top: 14px; max-width: 70ch; }
.privacy-line .ic { margin-top: 2px; color: var(--ok); }
.privacy-line.is-warn .ic { color: var(--warn); }
.compare-body .answer { margin-top: 4px; }
.forest { position: relative; display: grid; gap: 0; }
.fo-axis, .fo-row, .fo-refwrap { display: grid; grid-template-columns: 230px minmax(0, 1fr) 110px; gap: 16px; align-items: center; }
.fo-refwrap { position: absolute; inset: 18px 0 0; pointer-events: none; }
.fo-refwrap .fo-track { height: 100%; }
.fo-ref { position: absolute; top: 0; bottom: 0; border-left: 1px dashed color-mix(in srgb, var(--accent) 70%, transparent); }
.fo-axis .fo-track { position: relative; height: 18px; }
.fo-axis i { position: absolute; transform: translateX(-50%); font-style: normal; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
.fo-row { min-height: 52px; border-bottom: 1px solid var(--line-2); }
.fo-pooled { border-top: 1px solid var(--ink); border-bottom: 0; }
.fo-lab { display: grid; font-size: var(--t-sm); font-weight: 500; line-height: 1.3; }
.fo-lab small { font-size: var(--t-2xs); color: var(--ink-3); font-family: var(--font-mono); font-weight: 400; }
.fo-track { position: relative; height: 30px; }
.fo-ci { position: absolute; top: 50%; height: 2px; background: var(--ink-2); transform: translateY(-50%); }
.fo-sq { position: absolute; top: 50%; width: var(--w); height: var(--w); background: var(--accent); transform: translate(-50%, -50%); }
.fo-diamond { position: absolute; top: 50%; height: 16px; transform: translateY(-50%); background: var(--ink); clip-path: polygon(0 50%, 50% 0, 100% 50%, 50% 100%); }
.fo-pooled .fo-ci { display: none; }
.fo-val { text-align: right; display: grid; font-family: var(--font-mono); line-height: 1.25; }
.fo-val b { font-weight: 500; font-size: var(--t-sm); } .fo-val small { font-size: 10px; color: var(--ink-3); }
.compare-empty .h3 { max-width: 30ch; }

/* genomes */
.genome-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.genome { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.g-act { margin-top: auto; padding-top: 4px; }
.g-top { display: flex; gap: 6px; flex-wrap: wrap; }
.g-name { font-size: var(--t-md); font-weight: 500; overflow-wrap: anywhere; }
.g-big { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.g-big b { font-family: var(--font-display); font-weight: 400; font-size: 40px; line-height: 1; letter-spacing: -.02em; }
.g-big span { font-size: var(--t-xs); color: var(--ink-3); }
.g-dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.g-dl dd { font-size: var(--t-sm); }
.g-src { font-size: var(--t-xs); color: var(--ink-2); line-height: 1.5; }
.genome .btn { justify-self: start; }
.g-off { font-size: var(--t-xs); color: var(--ink-3); font-family: var(--font-mono); }

/* team */
.team-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.team-card { padding: 20px; }
.card-h { font-size: var(--t-md); font-weight: 600; margin-bottom: 12px; }
.members { list-style: none; }
.members li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-size: 19px; background: var(--accent-soft); color: var(--accent-text); }
.m-main { display: grid; min-width: 0; } .m-main b { font-weight: 600; font-size: var(--t-sm); overflow-wrap: anywhere; } .m-main small { font-size: var(--t-xs); color: var(--ink-3); }
.members .field { width: 150px; }
.invite { display: grid; gap: 12px; }
.invite .btn { justify-self: start; }
.roles { list-style: none; margin-top: 18px; display: grid; gap: 0; }
.roles li { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: var(--t-sm); }
.roles span { color: var(--ink-2); }

/* sign in + privacy */
#si-step > .fld { margin-top: 18px; }
.code-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 16px 0 4px; }
.code-boxes input { height: 54px; text-align: center; font-family: var(--font-mono); font-size: 22px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); outline: none; min-width: 0; }
.code-boxes input:focus { border-color: var(--ink-3); box-shadow: 0 0 0 4px var(--accent-soft); }
.how { list-style: none; display: grid; gap: 0; margin-bottom: 8px; }
.how li { display: flex; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line-2); }
.how li > span:last-child { display: grid; gap: 2px; font-size: var(--t-sm); color: var(--ink-2); }
.how li b { color: var(--ink); font-size: var(--t-md); }
.how-n { position: relative; flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; }
.how-n i { position: absolute; right: -6px; bottom: -6px; font-style: normal; font-size: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 0 3px; color: var(--ink-3); }
.plain-list { list-style: none; display: grid; gap: 10px; }
.plain-list li { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.55; padding-left: 14px; position: relative; }
.plain-list li::before { content: ''; position: absolute; left: 0; top: .7em; width: 6px; height: 1px; background: var(--ink-3); }
.plain-list b { color: var(--ink); }

/* ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .result-grid { grid-template-columns: minmax(0, 1fr) 290px; gap: 32px; }
  .fig-2 { grid-template-columns: 1fr; }
}
@media (max-width: 1060px) {
  .ask-grid { grid-template-columns: 1fr; }
  .preview { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pv-head { grid-column: 1 / -1; }
  .pv { border-right: 1px solid var(--line-2); }
  .result-grid { grid-template-columns: 1fr; }
  .result-side { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
  .srow { grid-template-columns: 100px minmax(0, 1fr) 96px 120px 20px; }
  .srow .sr-col:nth-of-type(5) { display: none; }
}
@media (max-width: 860px) {
  .sentence-wrap { padding: 38px 24px 6px; }
  .detail { padding: 6px 24px 0; } .adv { margin: 22px 24px 0; } .composer-foot { padding: 16px 24px 22px; }
  .before { margin: 20px 24px 0; }
  .collect-grid { grid-template-columns: 1fr; }
  .tell-grid { grid-template-columns: 1fr; }
  .srow { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; padding: 16px 4px; }
  .sr-status { grid-column: 1 / -1; }
  .sr-main { grid-column: 1 / -1; }
  .srow .sr-col { grid-column: auto; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
  .srow .sr-col .bm { display: none; }
  .srow .sr-col:nth-of-type(5) { display: flex; }
  .srow { grid-template-columns: repeat(3, minmax(0, 1fr)); position: relative; }
  .sr-go { position: absolute; right: 6px; top: 16px; }
  .team-grid { grid-template-columns: 1fr; }
  .fo-axis, .fo-row, .fo-refwrap { grid-template-columns: 150px minmax(0, 1fr) 84px; gap: 10px; }
}
@media (max-width: 640px) {
  .page-head { padding: 28px 0 20px; }
  .intents { grid-template-columns: 1fr 1fr; }
  .intent { border-bottom: 1px solid var(--line); min-height: 64px; padding: 11px 14px; }
  .intent:nth-child(2) { border-right: 0; }
  .intent:nth-child(3), .intent:nth-child(4) { border-bottom: 0; }
  .intent[aria-checked="true"]::after { display: none; }
  .sentence-wrap { padding: 32px 18px 4px; }
  .sentence { line-height: 1.55; }
  .slot-rs { font-size: 11px; }
  .detail { padding: 4px 18px 0; } .adv { margin: 18px 18px 0; } .composer-foot { padding: 14px 18px 20px; }
  .before { margin: 18px 18px 0; }
  .before-grid { grid-template-columns: 1fr; }
  .composer-foot .btn-primary { flex: 1; }
  .adv-grid { grid-template-columns: minmax(0, 1fr); }
  .adv-s { display: none; }
  .preview { grid-template-columns: 1fr; }
  .pv { border-right: 0; }
  .templates { margin-top: 44px; padding-top: 36px; }
  .tpl-grid { grid-template-columns: 1fr; }
  .tpl { min-height: 0; }
  .fig { padding: 16px 14px 12px; margin-left: calc(-1 * var(--gutter) + 8px); margin-right: calc(-1 * var(--gutter) + 8px); border-radius: var(--r-md); }
  .vchart { height: 200px; margin-left: 32px; } .vc-xs { margin-left: 32px; }
  .vc-x > span:not(.genotype) { font-size: 9.5px; }
  .st-axis, .st-row, .st-col { grid-template-columns: 92px minmax(0, 1fr) 46px; gap: 8px; }
  .strip-strat .st-axis, .strip-strat .st-row { grid-template-columns: 96px minmax(0, 1fr) 54px; }
  .stat-line { grid-template-columns: 1fr; }
  .stat-line > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .result-side { grid-template-columns: 1fr; }
  .answer { font-size: 28px; }
  .result-actions .btn { flex: 1 1 calc(50% - 8px); }
  .stage { height: 440px; }
  .stage-foot { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 14px; }
  .rv-facts { grid-template-columns: 1fr; }
  .sheet-body { padding: 24px 18px 0; }
  .sh-title { font-size: 30px; }
  .sh-foot .btn { flex: 1; }
  .pick-row { grid-template-columns: minmax(0, 1fr); }
  .sl-row { grid-template-columns: 112px minmax(0, 1fr); }
  /* touch targets: at least 40 px on phones */
  .btn-sm, .chip, .jump, .theme-toggle, .signin, .allele-btn, .seg button { min-height: 40px; }
  .field-sm { height: 42px; }
  .btn-icon, .btn-sm.btn-icon, .jump, .theme-toggle { min-width: 40px; }
  .jump, .theme-toggle { height: 40px; width: 40px; }
  .allele-btn { padding: 4px 8px 4px 4px; }
  .fo-axis, .fo-row { grid-template-columns: 1fr 64px; }
  .fo-axis > span:first-child, .fo-lab { grid-column: 1 / -1; }
  .fo-axis > span:first-child { display: none; }
  .fo-row { padding: 8px 0; }
  .fo-refwrap { display: none; }
  .ck-rows li { grid-template-columns: minmax(0, 1fr) 44px auto; }
  .ck-rows li .mono:nth-of-type(2) { display: none; }
  .members li { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .members .field { width: auto; grid-column: 2; }
  .members li > .btn { grid-row: 1; grid-column: 3; }
  .cite-dl > div { grid-template-columns: 1fr; gap: 2px; }
  .facts-dl > div { grid-template-columns: 104px minmax(0, 1fr); }
  .srow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .pop, .pop-phone .pop { animation: none; } }
