/* Cipher concept — c.geneticker.com. Accent = A (green). Builds on /shared tokens + base. */
:root { --accent: var(--A); --accent-text: var(--A-text); --accent-soft: var(--A-soft); --accent-btn: var(--A-btn); --accent-on: var(--A-on);
  --top-h: 60px; --rail-w: 248px; --tab-h: 64px; }

html { scroll-padding-top: calc(var(--top-h) + 16px); }
body { background: var(--paper); }
.ic { width: 18px; height: 18px; flex: none; }
.btn .ic { width: 17px; height: 17px; }
.link-btn { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; font: inherit; padding: 0; background: none; border: 0; cursor: pointer; }
.link-btn:hover { text-decoration-thickness: 2px; }
.spacer { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: auto; min-height: 26px; white-space: normal; padding: 3px 10px; }
.tag-mute { background: var(--accent-soft); color: var(--ink-2); }
main:focus { outline: none; }
[tabindex="-1"]:focus { outline: none; }

/* ── top bar ──────────────────────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 50; height: var(--top-h); background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-in { height: 100%; display: flex; align-items: center; gap: 14px; padding: 0 clamp(16px, 3vw, 28px); max-width: 1600px; margin: 0 auto; }
.topbar .wordmark b { font-size: 24px; }
.topbar-app { display: flex; align-items: center; gap: 10px; }
.topbar-app[hidden] { display: none; }
.search-btn { gap: 8px; color: var(--ink-2); min-width: 220px; justify-content: flex-start; }
.search-btn kbd { margin-left: auto; }
.ledger-btn { color: var(--ink-2); }
.switch { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px; font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); border-radius: var(--r-sm); }
.switch:hover { color: var(--ink); }
.switch-label { white-space: nowrap; }
.switch-track { width: 32px; height: 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); position: relative; transition: background var(--dur), border-color var(--dur); }
.switch-track i { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink-3); transition: transform var(--dur) var(--ease), background var(--dur); }
.switch[aria-checked="true"] .switch-track { background: var(--accent-btn); border-color: var(--accent-btn); }
.switch[aria-checked="true"] .switch-track i { transform: translateX(14px); background: var(--accent-on); }

/* ── START ───────────────────────────────────────────────────────────────── */
.view-start { 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; min-height: calc(100vh - var(--top-h)); }
.start { padding-top: clamp(28px, 4.5vw, 56px); padding-bottom: 72px; }
.start-head { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); column-gap: clamp(28px, 4vw, 64px); align-items: end; }
.start-kicker { color: var(--accent-text); margin-bottom: 16px; grid-column: 1 / -1; }
.start-title { font-size: clamp(44px, 5.9vw, 88px); }
.start-title em { color: var(--accent-text); }
.start-lede { font-size: clamp(16px, 1.45vw, 19px); max-width: 44ch; padding-bottom: 10px; }
.lede, .start-lede, .rcard-line, .ds-line, .group-intro { text-wrap: pretty; }
.start-notice { margin-bottom: 28px; padding: 14px 18px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--card); font-size: var(--t-sm); line-height: 1.55; max-width: 880px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.start-notice.is-info { border-color: var(--C-soft); background: var(--C-soft); }
.start-notice.is-ok { border-color: var(--A-soft); background: var(--A-soft); }
.start-notice.is-error { border-left: 3px solid var(--T); background: var(--T-soft); border-color: transparent; border-left-color: var(--T); }
.err-peek { display: block; width: 100%; font-size: var(--t-2xs); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err-actions { display: flex; gap: 8px; width: 100%; margin-top: 4px; }

.tray { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; margin-top: clamp(32px, 4vw, 52px); }
.drop { position: relative; min-height: 360px; border: 1.5px dashed color-mix(in srgb, var(--ink-3) 55%, transparent); border-radius: var(--r-lg); background: var(--card); overflow: hidden; display: grid; place-items: center; transition: border-color var(--dur), background var(--dur); }
.drop-canvas { position: absolute; inset: 0; width: 100%; height: 100%;
  -webkit-mask-image: radial-gradient(ellipse 46% 42% at 50% 50%, transparent 55%, #000 100%); mask-image: radial-gradient(ellipse 46% 42% at 50% 50%, transparent 55%, #000 100%); }
.drop[data-state="over"] { border-color: var(--accent); border-style: solid; background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
.drop[data-state="over"] .drop-canvas { -webkit-mask-image: none; mask-image: none; opacity: .55; }
.drop-in { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 32px 24px; max-width: 460px; }
.drop-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 6px; }
.drop-icon .ic { width: 24px; height: 24px; }
.drop-title { font-size: var(--t-xl); font-weight: 600; letter-spacing: -.015em; }
.drop-title-over, .drop[data-state="over"] .drop-title-idle { display: none; }
.drop[data-state="over"] .drop-title-over { display: inline; color: var(--accent-text); }
.drop-sub { color: var(--ink-2); font-size: var(--t-sm); max-width: 40ch; }
.drop-sub .mono { font-size: .92em; color: var(--ink); }
.drop-pick { margin-top: 8px; }
.tray-main { display: grid; gap: 14px; align-content: start; min-width: 0; }
.t-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .t-fine { display: none; } .t-touch { display: inline; } }
.drop-sm { min-height: 260px; }

.sample { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.sample-title { font-family: var(--font-display); font-weight: 400; font-size: 36px; line-height: 1; letter-spacing: -.01em; }
.sample-text { color: var(--ink-2); font-size: var(--t-sm); }
.sample-facts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 4px 0; }
.sample-facts div { padding: 10px 0; }
.sample-facts div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.sample-facts dt { font-size: var(--t-2xs); color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.sample-facts dd { font-size: var(--t-md); margin-top: 2px; }
.sample-btn { width: 100%; margin-top: auto; }
/* arrived from the homepage's "try a sample" link (#/sample): the card says where to start */
.sample.is-invited { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.sample-legal { font-size: var(--t-xs); color: var(--ink-3); line-height: 1.5; }
.sample-legal a { color: var(--ink-2); }

.promises { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.promises li { display: flex; gap: 14px; }
.promise-n { font-size: var(--t-xs); color: var(--accent-text); padding-top: 3px; }
.promises b { font-weight: 600; font-size: var(--t-md); }
.promises p { color: var(--ink-2); font-size: var(--t-sm); margin-top: 4px; }

.howto { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); scroll-margin-top: calc(var(--top-h) + 16px); }
.howto summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; font-weight: 600; min-height: 52px; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary .ic { transition: transform var(--dur) var(--ease); color: var(--ink-3); }
.howto[open] summary .ic { transform: rotate(90deg); }
.howto-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; padding: 6px 20px 22px; border-top: 1px solid var(--line-2); padding-top: 18px; }
.howto ol { margin-top: 8px; padding-left: 18px; color: var(--ink-2); font-size: var(--t-sm); display: grid; gap: 6px; }
.howto ol b { color: var(--ink); font-weight: 600; }
.start-legal { margin-top: 28px; font-size: var(--t-xs); color: var(--ink-3); }
.start-legal b { color: var(--ink-2); }

/* ── READING ─────────────────────────────────────────────────────────────── */
.view-reading { min-height: calc(100vh - var(--top-h)); display: flex; flex-direction: column; }
.reading-top { padding-top: clamp(28px, 5vh, 56px); }
.reading-top .label { color: var(--accent-text); }
.reading-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 4.5vw, 56px); line-height: 1.05; letter-spacing: -.01em; margin-top: 8px; overflow-wrap: anywhere; }
.reading-meta { color: var(--ink-3); font-size: var(--t-xs); margin-top: 8px; min-height: 1.5em; }
.helix-stage { flex: 1; min-height: clamp(240px, 44vh, 480px); position: relative; margin: 8px 0 4px; }
.helix-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.reading-bottom { padding-bottom: 40px; }
.stages { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stages li { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: var(--t-sm); font-weight: 500; transition: color var(--dur); }
.stage-dot { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; position: relative; transition: background var(--dur), border-color var(--dur); }
.stages li.is-active { color: var(--ink); }
.stages li.is-active .stage-dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulse 1.4s var(--ease) infinite; }
.stages li.is-done { color: var(--ink-2); }
.stages li.is-done .stage-dot { background: var(--accent); border-color: var(--accent); }
.stage-note { font-size: var(--t-2xs); color: var(--ink-3); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }
.progress { height: 2px; background: var(--line); margin: 14px 0 22px; border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
.counters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; }
.counters div { border-left: 1px solid var(--line); padding-left: 14px; }
.counters dt { font-size: var(--t-2xs); color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }
.counters dd { font-size: clamp(22px, 3vw, 34px); font-variant-numeric: tabular-nums; margin-top: 2px; }
.reading-actions { display: flex; align-items: center; gap: 18px; margin-top: 26px; flex-wrap: wrap; }
.reading-note { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: var(--t-sm); }
.reading-note .ic { color: var(--accent-text); }

/* ── REPORT shell ────────────────────────────────────────────────────────── */
.report-grid { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); max-width: 1600px; margin: 0 auto; }
.rail { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; border-right: 1px solid var(--line); padding: 24px 14px; display: flex; flex-direction: column; gap: 22px; }
.rail-file { padding: 0 10px 18px; border-bottom: 1px solid var(--line); }
.rail-name { font-size: var(--t-sm); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-facts { font-size: var(--t-2xs); color: var(--ink-3); margin-top: 2px; }
.rail-nav, .rail-tools { display: flex; flex-direction: column; gap: 2px; }
.rail-tools { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.rail-tools .label { padding: 0 10px 8px; }
.rail-link { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 10px; border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; font-size: var(--t-sm); font-weight: 500; text-align: left; width: 100%; position: relative; }
.rail-link:hover { background: var(--accent-soft); color: var(--ink); }
.rail-link[aria-current="page"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.rail-link[aria-current="page"]::before { content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.rail-link[aria-current="page"] .ic { color: var(--accent-text); }
.nav-count { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--G-soft); color: var(--G-text); }
.rail-forget { color: var(--T-text); }
.rail-forget:hover { background: var(--T-soft); color: var(--T-text); }
.report-main { padding: 40px clamp(20px, 4vw, 56px) 72px; min-width: 0; max-width: 1180px; }
.tabbar { display: none; }

/* section heads & groups */
.sec-head { margin-bottom: 30px; }
.sec-head .label { color: var(--accent-text); }
.sec-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(40px, 5vw, 66px); line-height: 1; letter-spacing: -.02em; margin-top: 10px; }
.sec-title em { color: var(--accent-text); }
.sec-head .lede { margin-top: 14px; }
.sec-simple { display: none; }
.group { margin-top: 48px; }
.group-head { display: flex; align-items: baseline; gap: 12px; padding-bottom: 12px; margin-bottom: 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.group-title { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.1; letter-spacing: -.01em; }
.group-count { font-size: var(--t-xs); color: var(--ink-3); }
.group-link { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); font-weight: 600; color: var(--accent-text); text-decoration: none; }
.group-link .ic { width: 15px; height: 15px; }
.group-intro { color: var(--ink-2); font-size: var(--t-sm); max-width: 70ch; margin-bottom: 16px; }
.group-foot { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; color: var(--ink-2); font-size: var(--t-sm); line-height: 1.5; }
.group-foot .ic { color: var(--ink-3); width: 16px; height: 16px; margin-top: 2px; }
.empty-line { color: var(--ink-3); font-size: var(--t-sm); padding: 8px 0; }

.ov-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ov-line { display: none; font-size: var(--t-xs); color: var(--ink-2); padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ov-stats div { padding: 14px 16px 14px 0; }
.ov-stats div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.ov-stats dd { font-size: 22px; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.2; }
.ov-sub { display: block; font-size: var(--t-2xs); color: var(--ink-3); letter-spacing: .04em; margin-top: 4px; }
.ov-line span { white-space: nowrap; }


/* ── reading cards ───────────────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 272px), 1fr)); gap: 14px; }
.cards + .cards, .cards + .nf, .cards + .revealed-note { margin-top: 14px; }
.cards-wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, max(320px, calc(50% - 7px))), 1fr)); }
.rcard { --tone: var(--ink-3); position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 15px; display: flex; flex-direction: column; gap: 7px; transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease); min-width: 0; }
.rcard:hover { border-color: color-mix(in srgb, var(--ink-3) 70%, var(--line)); }
.rcard:focus-within { border-color: var(--ink-3); }
.tone-ok { --tone: var(--A); --tone-text: var(--A-text); }
.tone-note { --tone: var(--C); --tone-text: var(--C-text); }
.tone-caution { --tone: var(--G); --tone-text: var(--G-text); }
.tone-risk { --tone: var(--T); --tone-text: var(--T-text); }
.tone-neutral { --tone-text: var(--ink-3); }
.tone-unknown { --tone-text: var(--ink-3); }
.rcard-head { display: flex; align-items: center; gap: 9px; min-height: 22px; }
.rcard-mark { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--tone); }
.rcard-title { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); letter-spacing: -.003em; line-height: 1.3; flex: 1; min-width: 0; }
.rcard-open { text-align: left; font: inherit; color: inherit; padding: 0; }
.rcard-open::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.rcard-open:focus-visible { outline: none; }
.rcard-open:focus-visible::after { outline: 2px solid var(--focus); outline-offset: 2px; }
.rcard-ev { flex: none; display: inline-flex; }
.rcard-answer { font-family: var(--font-display); font-size: 27px; line-height: 1.08; letter-spacing: -.012em; color: var(--ink); overflow-wrap: anywhere; }
.rcard-line { color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.rcard-geno { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 3px; font-size: 12px; }
.gl { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.gl-gene { font-size: 12px; color: var(--ink); }
.gl-rs { font-size: 11px; color: var(--ink-3); }
.gl-more { font-size: 11px; color: var(--ink-3); align-self: center; }
.rcard-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: auto; padding-top: 6px; }
.rcard-tone { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--tone-text); }
.rcard-not { flex-basis: 100%; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; font-style: italic; }
.rcard.tone-unknown { background: transparent; border-style: dashed; }
.rcard.tone-unknown .rcard-answer { color: var(--ink-3); }
.rcard.tone-risk { border-color: color-mix(in srgb, var(--T) 45%, var(--line)); }
.rcard.tone-caution { border-color: color-mix(in srgb, var(--G) 50%, var(--line)); }

.genotype .base { font-size: 12px; width: 21px; height: 21px; }
/* inferred = one dashed "ref" tile the width of two bases; confirmed reference = solid; absent = dotted */
.ref-tile { display: inline-grid; place-items: center; height: 21px; min-width: 45px; padding: 0 6px; border-radius: 4px; border: 1.25px dashed var(--ink-3); font-size: 10.5px; font-weight: 500; letter-spacing: .05em; color: var(--ink-2); line-height: 1; }
.genotype.is-confirmed .ref-tile { border-style: solid; }
.genotype.is-missing .ref-tile { border-style: dotted; color: var(--ink-3); }
.about-text .genotype { vertical-align: -5px; }
.geno-long { font-size: 11px; color: var(--ink-2); }

/* locked (Right not to know) */
.rcard.is-locked { background: repeating-linear-gradient(135deg, transparent 0 9px, color-mix(in srgb, var(--line) 55%, transparent) 9px 10px), var(--card); border-style: solid; }
.lock-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); flex: none; }
.lock-ic .ic { width: 14px; height: 14px; }
.is-locked .rcard-answer { font-size: 25px; }
.is-locked .rcard-foot { padding-top: 10px; }
.revealed-note { display: flex; align-items: center; gap: 8px; font-size: var(--t-xs); color: var(--ink-3); margin: 18px 0 10px; }
.revealed-note .ic { width: 15px; height: 15px; }

/* "not in your file" disclosure */
.nf { margin-top: 14px; border: 1px dashed color-mix(in srgb, var(--ink-3) 45%, transparent); border-radius: 12px; }
.nf summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 16px; min-height: 48px; font-size: var(--t-sm); font-weight: 500; color: var(--ink-2); }
.nf summary::-webkit-details-marker { display: none; }
.nf summary b { font-family: var(--font-mono); font-weight: 500; font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.nf summary .ic { margin-left: auto; color: var(--ink-3); transition: transform var(--dur) var(--ease); width: 16px; height: 16px; }
.nf[open] summary .ic { transform: rotate(90deg); }
.nf-intro { padding: 0 16px 10px; color: var(--ink-3); font-size: var(--t-xs); max-width: 72ch; }
.nf ul { list-style: none; padding: 0 8px 8px; }
.nf-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 8px; border-radius: 8px; text-align: left; font-size: var(--t-sm); color: var(--ink); }
.nf-row:hover { background: var(--accent-soft); }
.nf-row > span:first-child { flex: 1; min-width: 0; }
.nf-row .ic { color: var(--ink-3); width: 15px; height: 15px; }
.nf-genes { font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46%; }
.nf-plain { display: flex; justify-content: space-between; gap: 12px; padding: 10px 8px; font-size: var(--t-sm); border-top: 1px solid var(--line-2); }
.nf .rx-list { padding: 0 16px 8px; }

/* overview extras */
.tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tool { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-decoration: none; color: var(--ink); text-align: left; font: inherit; transition: border-color var(--dur); }
.tool:hover { border-color: var(--ink-3); }
.tool .ic { color: var(--accent-text); width: 22px; height: 22px; margin-bottom: 6px; }
.tool b { font-weight: 600; font-size: var(--t-md); }
.tool span { color: var(--ink-2); font-size: var(--t-sm); line-height: 1.45; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.about-text { display: grid; gap: 10px; color: var(--ink-2); font-size: var(--t-sm); max-width: 62ch; }
.about-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); font-size: var(--t-xs); }
.about-facts div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.about-facts dt { color: var(--ink-3); font-size: var(--t-2xs); letter-spacing: .06em; text-transform: uppercase; }
.about-facts dd { margin-top: 2px; overflow-wrap: anywhere; }

/* ── medicines ───────────────────────────────────────────────────────────── */
.em-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; margin-top: 28px; padding: 16px 18px; border: 1px solid var(--line); border-left: 3px solid var(--T); border-radius: 14px; background: var(--card); }
.em-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--T-soft); color: var(--T-text); }
.em-ic .ic { width: 19px; height: 19px; }
.em-title { font-size: var(--t-md); font-weight: 600; line-height: 1.3; }
.em-copy p { color: var(--ink-2); font-size: var(--t-sm); max-width: 62ch; margin-top: 2px; }
.em-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.em-card-wrap { display: none; }
@media (min-width: 1024px) {
  /* wide: the card mock is the picture, so the small icon steps aside */
  .em-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 300px); grid-template-rows: auto auto; padding: 22px 24px 22px 28px; }
  .em-ic { display: none; }
  .em-copy { align-self: end; }
  .em-actions { grid-column: 1; align-self: start; margin-top: 8px; }
  .em-card-wrap { display: grid; place-items: center; grid-column: 2; grid-row: 1 / 3; padding: 6px; container-type: inline-size; }
  .em-card-wrap .wallet { transform: rotate(-2.5deg); box-shadow: var(--shadow-2); }
}
@container (max-width: 360px) { .wallet.is-mini .wallet-items em { display: none; } }

.wallet { width: 100%; max-width: 360px; aspect-ratio: 85.6 / 54; background: #fffdf8; color: #131513; border-radius: 12px; border: 1px solid #cfcabd; padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 11px; overflow: hidden; }
.wallet-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 500; padding-bottom: 6px; border-bottom: 1.5px solid #dd3c43; color: #b4262d; }
.wallet-ic { width: 14px; height: 14px; color: #b4262d; stroke-width: 2; }
.wallet-more { color: #484d49; font-style: italic; }
.wallet-name { font-size: 10px; color: #484d49; display: flex; gap: 6px; align-items: flex-end; }
.wallet-name span { flex: 1; border-bottom: 1px solid #b9b4a6; height: 12px; }
.wallet-items { list-style: none; display: grid; gap: 5px; }
.wallet-items li { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; line-height: 1.3; }
.wallet-items b { font-family: var(--font-mono); font-weight: 500; font-size: 10px; }
.wallet-items em { grid-column: 2; font-style: normal; color: #6b716c; font-size: 9.5px; }
.wallet-foot { margin-top: auto; font-size: 8.5px; color: #6b716c; line-height: 1.35; }
.wallet.is-mini .wallet-items li { font-size: 12px; }
.wallet-nc { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: 9.5px; line-height: 1.3; }
.wallet-nc li::before { content: '○ '; color: #6b716c; }
.em-preview { display: grid; gap: 16px; margin: 18px 0; justify-items: start; }
.em-preview .wallet { max-width: 420px; box-shadow: var(--shadow-1); }

.rx-list { display: grid; }
.rx { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--line-2); position: relative; }
.rx:first-child { border-top: 0; }
.rx-title { font-size: var(--t-md); font-weight: 600; }
.rx-gene { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.rx-state { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; color: var(--tone-text, var(--ink-2)); text-transform: uppercase; white-space: nowrap; }
.rx-avoid { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; position: relative; z-index: 1; }
.rx .rcard-open::after { border-radius: 8px; }
.rx-note { font-size: var(--t-xs); color: var(--ink-3); }
.rx:hover { background: var(--card); }

/* ── health ──────────────────────────────────────────────────────────────── */
.partner-cta { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 16px 18px; border-radius: 14px; background: var(--accent-soft); color: var(--ink); text-decoration: none; font-size: var(--t-sm); }
.partner-cta > .ic:first-child { color: var(--accent-text); width: 24px; height: 24px; }
.partner-cta > .ic:last-child { margin-left: auto; color: var(--accent-text); }
.partner-cta:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.prs .pctl { position: relative; height: 34px; margin: 8px 0 0; }
.pctl-track { position: absolute; left: 0; right: 0; top: 6px; height: 8px; display: flex; border-radius: 4px; overflow: hidden; }
.pctl-track span { background: var(--line-2); border-right: 1px solid var(--card); }
.pctl-track span:nth-child(2n) { background: var(--line); }
.pc-mark { position: absolute; top: 3px; width: 2px; height: 14px; margin-left: -1px; background: color-mix(in srgb, var(--ink-3) 70%, transparent); border-radius: 1px; }
.pc-mark.is-ref { top: 0; width: 4px; height: 20px; margin-left: -2px; background: var(--tone, var(--ink)); z-index: 1; }
.tone-neutral .pc-mark.is-ref { background: var(--ink); }
.pc-mark.is-ref span { font-style: normal; position: absolute; top: 22px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.pctl-scale { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--ink-3); margin-top: 0; }
.pctl-others { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.pctl-others b { font-weight: 500; font-size: 11px; color: var(--ink-2); }
.cv-list { list-style: none; display: grid; }
.cv-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-2); font-size: var(--t-sm); }
.cv-rs { font-size: 11px; color: var(--ink-3); }

/* ── ancestry ────────────────────────────────────────────────────────────── */
.anc { padding: 26px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); margin-top: 0; }
.anc-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.anc-answer { font-family: var(--font-display); font-size: clamp(34px, 4vw, 48px); line-height: 1; letter-spacing: -.015em; }
.anc-bar { display: flex; height: 46px; border-radius: 10px; overflow: hidden; margin: 22px 0 12px; gap: 2px; }
.anc-bar span { display: flex; align-items: center; padding: 0 12px; min-width: 0; }
.anc-bar b { font-weight: 500; font-size: 12px; color: var(--paper); }
/* population shares are not states, so they don't borrow A/C/G/T: an ink ramp instead */
.seg-0 { background: var(--ink); } .seg-1 { background: color-mix(in srgb, var(--ink) 72%, var(--paper)); } .seg-2 { background: color-mix(in srgb, var(--ink) 52%, var(--paper)); }
.seg-3 { background: color-mix(in srgb, var(--ink) 36%, var(--paper)); } .seg-4 { background: color-mix(in srgb, var(--ink) 24%, var(--paper)); }
.anc-bar .seg-3 b, .anc-bar .seg-4 b { color: var(--ink); }
.anc-compass { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 22px 0 8px; }
.anc-compass span { min-height: 54px; border: 1.25px dashed color-mix(in srgb, var(--ink-3) 60%, transparent); border-radius: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; padding: 6px 4px; text-align: center; color: var(--ink-3); font-size: var(--t-xs); }
.anc-compass b { font-weight: 500; }
.anc-compass .is-lean { border: 1.5px solid var(--ink); color: var(--ink); background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--ink-3) 22%, transparent) 6px 7px); }
.anc-compass .is-lean b { font-weight: 600; }
.anc-compass i { font-style: normal; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.anc-compass-note { font-size: var(--t-2xs); color: var(--ink-2); }
.anc-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--t-sm); }
.anc-legend li { display: inline-flex; align-items: center; gap: 7px; }
.anc-legend i { width: 10px; height: 10px; border-radius: 2px; }
.anc-legend .mono { color: var(--ink-3); font-size: 12px; }
.anc-line { color: var(--ink-2); font-size: var(--t-sm); margin-top: 14px; max-width: 70ch; }
.fp { margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.fp-cells { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; margin: 12px 0 10px; max-width: 560px; }
.fp-cells i, .fp-key i { aspect-ratio: 1; border-radius: 3px; display: block; }
.fp-0 { background: color-mix(in srgb, var(--ink-3) 30%, var(--card)); } .fp-1 { background: var(--ink-3); } .fp-2 { background: var(--ink); } .fp-n { box-shadow: inset 0 0 0 1px var(--ink-3); opacity: .45; }
.fp-key { display: flex; gap: 16px; font-size: 10.5px; color: var(--ink-3); flex-wrap: wrap; }
.fp-key span { display: inline-flex; align-items: center; gap: 6px; }
.fp-key i { width: 10px; height: 10px; }

/* ── report ──────────────────────────────────────────────────────────────── */
.rep-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.paper-page { background: #fffdf8; color: #131513; border: 1px solid var(--line); border-radius: 10px; padding: clamp(18px, 3vw, 34px); box-shadow: var(--shadow-1); font-size: 12px; }
.rep-side { display: grid; gap: 14px; }
.rep-act { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); display: grid; gap: 10px; justify-items: start; }
.rep-act .group-title { font-size: 24px; }
.rep-act p { color: var(--ink-2); font-size: var(--t-sm); }
.notin { display: grid; gap: 10px; color: var(--ink-2); font-size: var(--t-sm); max-width: 78ch; }
.notin b { color: var(--ink); font-weight: 600; }
.rep-more .tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-forget .ic, .tool-forget b { color: var(--T-text); }
.tool-forget:hover { border-color: color-mix(in srgb, var(--T) 50%, var(--line)); }
.rep-facts { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); column-gap: 24px; }

.doc { color: #131513; }
.doc-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid #131513; padding-bottom: 10px; }
.doc-kicker { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: #6b716c; }
.doc-title { font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.1; margin-top: 4px; }
.doc-meta { font-size: 10px; text-align: right; color: #484d49; line-height: 1.5; }
.doc-stamp { margin: 12px 0; padding: 8px 10px; border-left: 3px solid #d59a06; background: #faf3df; font-size: 11px; }
.doc-h { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #484d49; margin: 18px 0 6px; font-weight: 500; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.doc-table th { text-align: left; font-weight: 600; border-bottom: 1px solid #131513; padding: 5px 6px 5px 0; }
.doc-table td { border-bottom: 1px solid #e2ddd1; padding: 6px 6px 6px 0; vertical-align: top; }
.doc-table td.mono { font-size: 10px; color: #484d49; }
.doc-note { margin-top: 8px; font-size: 11px; color: #484d49; }
.doc-foot { margin-top: 18px; padding-top: 10px; border-top: 1px solid #d8d4c9; font-size: 9.5px; color: #6b716c; display: grid; gap: 4px; }

/* ── partner ─────────────────────────────────────────────────────────────── */
.pc-pick { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
.pc-sample { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 10px; justify-content: center; align-items: flex-start; }
.pc-consent, .pc-reading { padding: 26px; display: grid; gap: 14px; max-width: 640px; justify-items: start; }
.pc-consent p { color: var(--ink-2); font-size: var(--t-sm); }
.pc-reading .progress { width: 100%; margin: 4px 0; }
.pc-reading .counters { width: 100%; }
.err-card { padding: 14px 18px; border-radius: var(--r-md); background: var(--T-soft); border-left: 3px solid var(--T); margin-bottom: 18px; font-size: var(--t-sm); }
.err-card p { color: var(--ink-2); margin-top: 4px; }
.pc-summary { padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); display: grid; gap: 8px; justify-items: start; }
.pc-big { font-family: var(--font-display); font-size: clamp(30px, 3.4vw, 42px); line-height: 1.05; letter-spacing: -.015em; }
.pc-lede { font-size: var(--t-md); color: var(--ink-2); max-width: 64ch; line-height: 1.55; }
.pc-file { font-size: var(--t-xs); color: var(--ink-2); }
.pc-tech { font-size: var(--t-xs); color: var(--ink-3); }
.pc-tech summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; color: var(--ink-2); }
/* disclosure chevrons for the small "Technical note/detail" toggles (display:flex drops the native marker) */
.pc-tech summary::-webkit-details-marker, .ds-engine summary::-webkit-details-marker { display: none; }
.pc-tech summary::before, .ds-engine summary::before { content: ''; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); margin: 0 10px 0 2px; transition: transform var(--dur) var(--ease); flex: none; }
.pc-tech[open] summary::before, .ds-engine[open] summary::before { transform: rotate(45deg); }
.pc-tech p { font-size: var(--t-xs) !important; color: var(--ink-2) !important; margin-top: 4px; line-height: 1.5; }
.pc-meta { font-size: var(--t-xs); color: var(--ink-3); }
.pc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 14px; }
.pc { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 12px; align-content: start; }
.pc.tone-risk { border-color: color-mix(in srgb, var(--T) 45%, var(--line)); }
.pc-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.pc-head h3 { font-size: var(--t-md); font-weight: 600; flex: 1; min-width: 12ch; }
.pc-gene { font-size: 11px; color: var(--ink-3); }
.pc-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pc-sides > div { display: grid; gap: 6px; justify-items: start; }
.pc-chip { font-family: var(--font-mono); font-size: 11px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.pc-chip.is-one { background: var(--G-soft); border-color: transparent; color: var(--G-text); }
.pc-chip.is-two { background: var(--T-soft); border-color: transparent; color: var(--T-text); }
.pc-chip.is-zero { background: var(--A-soft); border-color: transparent; color: var(--A-text); }
.pc-chip.is-unk { border-style: dashed; color: var(--ink-3); }
.pc p { font-size: var(--t-sm); color: var(--ink-2); }
.pc p.label { font-size: var(--t-2xs); color: var(--ink-3); }
.pc p b { color: var(--ink); }
.pc-cov { font-size: var(--t-xs) !important; color: var(--ink-3) !important; }
.odds { display: flex; height: 30px; border-radius: 7px; overflow: hidden; gap: 2px; }
.odds span { display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; }
.odds b { font-weight: 500; font-size: 11px; }
.odds-a { background: var(--T); color: #fff; } .odds-c { background: var(--G); color: #1a1300; } .odds-n { background: var(--line); color: var(--ink-2); }
.odds-key { display: flex; gap: 16px; font-size: 10.5px; color: var(--ink-3); margin: -6px 0 14px; flex-wrap: wrap; }
.odds-key span { display: inline-flex; align-items: center; gap: 6px; }
.odds-key i { width: 10px; height: 10px; border-radius: 2px; }
.whatif { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.whatif .label { margin-bottom: 6px; }
.trait-odds { display: grid; gap: 8px; margin: 4px 0; }
.trait-odds div { display: grid; grid-template-columns: minmax(0, 9em) 1fr 3em; gap: 10px; align-items: center; font-size: var(--t-sm); }
.trait-odds i { height: 8px; border-radius: 4px; background: var(--accent); display: block; min-width: 2px; }
.trait-odds b { font-weight: 500; font-size: 12px; text-align: right; }
.pc-fine { margin-top: 28px; font-size: var(--t-xs); color: var(--ink-3); max-width: 80ch; }

/* ── sheets ──────────────────────────────────────────────────────────────── */
.has-sheet body { overflow: hidden; }
.sheet-wrap { position: fixed; inset: 0; z-index: 1000; }
.sheet-scrim { position: absolute; inset: 0; background: var(--overlay); opacity: 0; transition: opacity .2s var(--ease); }
.sheet { position: absolute; background: var(--paper); box-shadow: var(--shadow-2); display: flex; flex-direction: column; opacity: 0; transition: transform .22s var(--ease), opacity .22s var(--ease); outline: none; }
.sheet-body { overflow-y: auto; padding: 30px 30px 34px; overscroll-behavior: contain; }
.sheet-close { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--paper); }
.sheet-wrap.is-open .sheet-scrim { opacity: 1; }
.sheet-wrap.is-open .sheet { opacity: 1; transform: none; }
.sheet-side .sheet { top: 0; right: 0; bottom: 0; width: min(560px, 100vw); border-left: 1px solid var(--line); transform: translateX(28px); }
.sheet-center .sheet { left: 50%; top: 50%; width: min(660px, calc(100vw - 32px)); max-height: min(88vh, 900px); border-radius: var(--r-lg); border: 1px solid var(--line); transform: translate(-50%, calc(-50% + 14px)); }
.sheet-wrap.sheet-center.is-open .sheet { transform: translate(-50%, -50%); }
.sheet-palette .sheet { left: 50%; top: 12vh; width: min(640px, calc(100vw - 24px)); max-height: 70vh; border-radius: var(--r-lg); border: 1px solid var(--line); transform: translate(-50%, -8px); }
.sheet-wrap.sheet-palette.is-open .sheet { transform: translate(-50%, 0); }
.sheet-palette .sheet-body { padding: 0; }

/* detail sheet */
.ds-kicker { color: var(--accent-text); padding-right: 48px; }
.ds-title { font-size: var(--t-lg); font-weight: 600; margin-top: 8px; color: var(--ink-2); }
.ds-answer { font-family: var(--font-display); font-size: clamp(34px, 4vw, 44px); line-height: 1.03; letter-spacing: -.015em; margin-top: 4px; display: flex; align-items: baseline; gap: 12px; }
.ds-answer .rcard-mark { width: 11px; height: 11px; transform: translateY(-5px); }
.ds-tone { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--tone-text); margin-top: 6px; }
.tech-list { list-style: none; display: grid; gap: 6px; margin: 8px 0 4px; }
.tech-list li { font-size: 11px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
.tech-list b { font-weight: 500; color: var(--ink); }
.ds-line { margin-top: 12px; color: var(--ink); font-size: var(--t-md); line-height: 1.6; }
.ds-more { color: var(--ink-2); font-size: var(--t-sm); }
.ds-why { font-size: var(--t-xs); color: var(--ink-3); }
.ds-sec { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.ds-sec p { color: var(--ink-2); font-size: var(--t-sm); line-height: 1.6; }
.ds-sec p + p { margin-top: 8px; }
.ds-h { font-family: var(--font-mono); font-size: var(--t-2xs); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.ds-small { font-size: var(--t-xs) !important; color: var(--ink-3) !important; margin-top: 8px; }
.gt-list { list-style: none; display: grid; gap: 2px; }
.gt-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.gt-list .genotype .base { width: 26px; height: 26px; font-size: 14px; }
.gt-ids { display: flex; flex-direction: column; min-width: 0; }
.gt-gene { font-size: var(--t-sm); }
.gt-rs { font-size: 11.5px; color: var(--ink-3); }
.gt-state { font-size: 10.5px; color: var(--ink-3); text-align: right; text-transform: uppercase; letter-spacing: .05em; }
.gt-meaning { grid-column: 2 / -1; font-size: 13px; color: var(--ink-2); }
.gt-meaning:empty { display: none; }
.gt-list .ref-tile { height: 26px; min-width: 55px; font-size: 12px; }
.sure-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.sure-row .evidence i { width: 8px; height: 16px; }
.who { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.who li { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; font-size: var(--t-sm); background: var(--card); }
.who .ic { width: 16px; height: 16px; color: var(--ink-3); }
.care { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.care p { margin-top: 4px; }
.care-name { color: var(--ink) !important; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.learn { list-style: none; display: grid; gap: 4px; }
.learn a { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); color: var(--accent-text); min-height: 32px; }
.learn .ic { width: 14px; height: 14px; }
.ds-engine { margin-top: 24px; font-size: var(--t-xs); color: var(--ink-3); }
.ds-engine summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.ds-engine p { font-size: 11px; line-height: 1.6; margin-top: 6px; overflow-wrap: anywhere; color: var(--ink-2); }
.ds-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* consent + reveal */
.sheet-consent .sheet-body, .sheet-reveal .sheet-body { padding: 30px 30px 0; }
.cs-title, .rv-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 4vw, 40px); line-height: 1.05; letter-spacing: -.01em; margin-top: 8px; }
.cs-lede, .rv-context { color: var(--ink-2); font-size: var(--t-sm); margin-top: 10px; max-width: 58ch; }
.cs-list { list-style: none; display: grid; gap: 10px; margin-top: 22px; }
.tick { display: grid; grid-template-columns: 24px auto minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; transition: border-color var(--dur), background var(--dur); position: relative; }
.tick:hover { border-color: var(--ink-3); }
.tick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tick-box { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--ink-3); display: grid; place-items: center; color: transparent; background: var(--paper); transition: background var(--dur), border-color var(--dur); margin-top: 1px; }
.tick-box .ic { width: 15px; height: 15px; stroke-width: 2.4; }
.tick input:checked + .tick-box { background: var(--accent-btn); border-color: var(--accent-btn); color: var(--accent-on); }
.tick input:focus-visible + .tick-box { outline: 2px solid var(--focus); outline-offset: 2px; }
.tick:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.tick-n { font-size: 10.5px; color: var(--ink-3); padding-top: 3px; }
.tick-text { font-size: var(--t-sm); line-height: 1.55; }
.cs-docs { margin-top: 16px; font-size: var(--t-xs); color: var(--ink-3); }
.cs-file { text-transform: none; letter-spacing: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.cs-docs a { color: var(--ink-2); }
.cs-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 16px 0 24px; margin-top: 12px; background: var(--paper); border-top: 1px solid var(--line); }
.cs-count { margin-right: auto; font-size: var(--t-xs); color: var(--ink-3); }
.cs-foot.is-ready .cs-count { color: var(--accent-text); }
.rv-weigh { list-style: none; display: grid; gap: 12px; margin: 22px 0 6px; }
.rv-weigh li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; font-size: var(--t-sm); color: var(--ink-2); }
.rv-weigh b { color: var(--ink); font-weight: 600; }
.rv-weigh .ic { color: var(--ink-3); margin-top: 1px; }
.rv-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 22px 0 8px; flex-wrap: wrap; }
.rv-step { font-size: var(--t-2xs); color: var(--ink-3); padding-bottom: 22px; text-align: right; }
.pc-consent .rv-actions { padding: 6px 0 0; justify-content: flex-start; }
.pc-consent .tick { width: 100%; grid-template-columns: 24px minmax(0, 1fr); }

/* palette */
.pal-field { height: 58px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 0 18px; box-shadow: none !important; }
.pal-field .ic { color: var(--ink-3); }
.pal-field input { font-size: var(--t-lg); }
.pal-field input::-webkit-search-cancel-button { display: none; }
.pal-results { list-style: none; max-height: 52vh; overflow-y: auto; padding: 8px; }
.pal-results li[role="option"] { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "k" "t" "a"; gap: 1px 0; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.pal-results li[aria-selected="true"] { background: var(--accent-soft); }
.pal-k { grid-area: k; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.pal-results b { grid-area: t; font-weight: 600; font-size: var(--t-md); }
.pal-a { grid-area: a; color: var(--ink-2); font-size: 13px; line-height: 1.4; }
@media (hover: none) { .pal-kbd { display: none; } }
.pal-empty { padding: 18px 12px; color: var(--ink-3); font-size: var(--t-sm); }
.pal-hint { font-size: var(--t-2xs); color: var(--ink-3); padding: 10px 20px 14px; border-top: 1px solid var(--line-2); }

/* ledger */
.lg-title { font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1.05; margin-top: 8px; padding-right: 40px; }
.lg-lede { color: var(--ink-2); font-size: var(--t-sm); margin-top: 10px; }
.lg-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 20px 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lg-stats div { padding: 12px 0; }
.lg-stats div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.lg-stats dd { font-size: 22px; margin-top: 2px; }
.lg-zero { color: var(--accent-text); }
.lg-origins, .lg-note { display: flex; gap: 8px; align-items: flex-start; font-size: var(--t-xs); color: var(--ink-2); line-height: 1.5; }
.lg-origins .ic, .lg-note .ic { width: 16px; height: 16px; color: var(--accent-text); flex: none; margin-top: 1px; }
.lg-note { margin-top: 8px; }
.lg-list { list-style: none; margin-top: 16px; border-top: 1px solid var(--line); }
.lg-list li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: var(--t-xs); }
.lg-t { color: var(--ink-3); font-size: 10.5px; }
.lg-what { display: flex; flex-direction: column; min-width: 0; }
.lg-what .mono { font-size: 10.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-size { font-size: 10.5px; color: var(--ink-2); }
.lg-incoming { background: var(--C-soft); margin: 0 -10px; padding-left: 10px !important; padding-right: 10px !important; border-radius: 6px; }
.lg-forget { position: sticky; bottom: -34px; margin: 18px -30px -34px; padding: 14px 30px 20px; background: var(--paper); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.lg-forget p { color: var(--ink-2); font-size: var(--t-xs); flex: 1 1 240px; }
.btn-forget { color: var(--T-text); border-color: color-mix(in srgb, var(--T) 45%, var(--line)); }
.btn-forget:hover { background: var(--T-soft); color: var(--T-text); }
.btn-forget .ic { width: 15px; height: 15px; }

/* legal footer */
.legal-foot { border-top: 1px solid var(--line); padding: 18px clamp(16px, 4vw, 40px); font-size: var(--t-xs); color: var(--ink-3); text-align: center; }
.legal-foot b { color: var(--ink-2); }
.legal-foot a { color: var(--ink-2); }

/* toast above tab bar */
.toast-host { bottom: 24px; max-width: calc(100vw - 32px); z-index: 1100; }

/* ── responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .howto-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 1023px) {
  :root { --top-h: 56px; }
  .report-grid { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .report-main { padding: 28px 20px calc(var(--tab-h) + 40px); }
  .tabbar { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--paper); border-top: 1px solid var(--line); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: var(--ink-3); font-size: 10.5px; font-weight: 500; position: relative; min-width: 0; }
  .tab .ic { width: 21px; height: 21px; }
  .tab[aria-current="page"] { color: var(--ink); }
  .tab[aria-current="page"] .ic { color: var(--accent-text); }
  .tab[aria-current="page"]::before { content: ''; position: absolute; top: -1px; left: 22%; right: 22%; height: 2px; background: var(--accent); border-radius: 0 0 2px 2px; }
  .tab .nav-count { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 4px; margin: 0; }
  body[data-view="report"] .legal-foot { padding-bottom: calc(var(--tab-h) + 24px); }
  body[data-view="report"] .toast-host { bottom: calc(var(--tab-h) + 16px); }
  .rep-grid { grid-template-columns: minmax(0, 1fr); }
  .rep-side { order: -1; }
}
@media (max-width: 860px) {
  .tray, .pc-pick, .start-head { grid-template-columns: minmax(0, 1fr); }
  .howto-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .start-lede { margin-top: 18px; padding-bottom: 0; }
  .drop { min-height: 260px; }
  .promises { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .search-btn { min-width: 0; }
  .search-label, .search-btn kbd { display: none; }
  .search-btn { width: 36px; padding: 0; justify-content: center; }
}
@media (max-width: 640px) {
  .topbar-in { gap: 6px; }
  .topbar-app { gap: 6px; }
  .topbar-in > *, .topbar-app > * { flex: none; }
  .topbar-in > .spacer { flex: 1; }
  .cf-long { display: none; }
  .rx { grid-template-columns: minmax(0, 1fr); }
  .rx-state { white-space: normal; }
  .rep-more .tools { grid-template-columns: minmax(0, 1fr); }
  .topbar .wordmark small { display: none; }
  .topbar .wordmark b { font-size: 21px; }
  .concept-flag { font-size: 9.5px; padding: 2px 7px; }
  /* phone top bar: three round 40px buttons, each with an accessible name; "Explain simply"
     moves into each section, labelled */
  .ledger-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  /* same as the shared 40px .theme-toggle circle */
  .search-btn, .ledger-btn { width: 40px; height: 40px; min-width: 40px; padding: 0; justify-content: center; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--card); color: var(--ink-2); }
  .topbar-app .switch { display: none; }
  .sec-simple { display: inline-flex; margin-top: 14px; height: 40px; padding: 0 12px 0 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: var(--t-xs); }
  .ov-stats { display: none; }
  .ov-line { display: block; }
  .em-hero { grid-template-columns: auto minmax(0, 1fr); }
  .em-actions { grid-column: 1 / -1; }
  /* start on a phone: the sample first (most phones hold no genome file), a compact picker */
  .tray { display: flex; flex-direction: column; }
  .sample { order: -1; }
  .drop { min-height: 0; }
  .drop-canvas, .drop-icon, .drop-sub { display: none; }
  .drop-in { padding: 18px 16px; gap: 6px; }
  .drop-title { font-size: var(--t-md); }
  .drop-pick { margin-top: 4px; }
  .howto-grid { grid-template-columns: minmax(0, 1fr); }
  .start-head { row-gap: 0; }
  .tray { margin-top: 24px; }
  .start-title { font-size: clamp(42px, 12.5vw, 60px); }
  .sample { padding: 22px; }
  .stages { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .counters dd { font-size: 22px; }
  .tools { grid-template-columns: minmax(0, 1fr); }
  .group-title { font-size: 26px; }
  .anc { padding: 20px; }
  .anc-compass { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .anc-compass span { font-size: 11px; min-height: 58px; }
  .lg-forget { margin: 18px -20px -30px; padding: 14px 20px 18px; bottom: -30px; }
  .whatif, .pc-sides { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .lg-stats dd { font-size: 18px; }
  .sheet-side .sheet, .sheet-center .sheet { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; border: 0; border-top: 1px solid var(--line); transform: translateY(32px); }
  .sheet-wrap.sheet-center.is-open .sheet, .sheet-wrap.sheet-side.is-open .sheet { transform: none; }
  .sheet-body { padding: 26px 20px 30px; }
  .sheet-consent .sheet-body, .sheet-reveal .sheet-body { padding: 26px 20px 0; }
  .tick { grid-template-columns: 24px minmax(0, 1fr); }
  .tick-n { display: none; }
  .gt-list li { grid-template-columns: auto minmax(0, 1fr); }
  .gt-state { grid-column: 2; text-align: left; }
  .doc-head { flex-direction: column; }
  .doc-meta { text-align: left; }
  .trait-odds div { grid-template-columns: minmax(0, 7.5em) 1fr 3em; }
}
@media (max-width: 380px) {
  .topbar .wordmark { gap: 7px; }
  .topbar .wordmark b { font-size: 19px; }
  .topbar-in, .topbar-app { gap: 4px; }
  .tab { font-size: 9.5px; }
}

/* ── print ───────────────────────────────────────────────────────────────── */
#print-root { display: none; }
@media print {
  html.print-emergency body > *:not(#print-root), html.print-doctor body > *:not(#print-root) { display: none !important; }
  html.print-emergency #print-root, html.print-doctor #print-root { display: block; }
  body { background: #fff !important; }
  .print-hint { font: 10px var(--font-mono); color: #6b716c; margin-bottom: 4mm; }
  .print-pair { display: flex; gap: 0; }
  .print-pair .wallet { width: 85.6mm; height: 54mm; max-width: none; aspect-ratio: auto; border-radius: 3mm; border: .3mm solid #131513; padding: 3mm 3.5mm; font-size: 7.5pt; }
  .print-pair .wallet + .wallet { border-left: .3mm dashed #6b716c; border-top-left-radius: 0; border-bottom-left-radius: 0; }
  .print-pair .wallet:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
  .print-pair .wallet-head { font-size: 6.5pt; }
  .print-pair .wallet-items b { font-size: 7pt; } .print-pair .wallet-items em { font-size: 6.5pt; }
  .print-pair .wallet-foot { font-size: 5.5pt; }
  .print-doc { font-size: 10pt; }
  .print-doc .doc-table { font-size: 9pt; }
  @page { margin: 14mm; }
}
