/* GenoNerd — sage ground, deep teal, marigold accent, violet for family. Desktop first; phones adapt below 760px. */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 500; font-display: swap; src: url("fonts/bricolage-grotesque-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 700; font-display: swap; src: url("fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }

:root {
  --ground: #F3F6F1; --card: #FFFFFF; --ink: #1D2B2A; --ink-2: #33423F; --muted: #4C5B59; --line: #DDE4E1;
  --teal: #0F5E5A; --teal-dark: #0A4441; --teal-tint: #DCEDEA; --teal-pale: #E4F0EE;
  --gold: #F2B441; --gold-ink: #8A5200; --gold-tint: #FCEFD3;
  --violet: #5546B8; --violet-ink: #2B2168; --violet-tint: #E9E6FA;
  --danger: #A3341F; --danger-tint: #FBE9E4;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5; }
a { color: var(--teal); } a:hover { color: var(--teal-dark); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; letter-spacing: -0.3px; }
h1 { font-size: 40px; line-height: 1.08; letter-spacing: -0.8px; }
h2 { font-size: 20px; line-height: 1.2; }
h3 { font-size: 21px; line-height: 1.2; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }

.shell { max-width: 1160px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 32px 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.3px; }
.brand:hover { color: var(--ink); }
.avatar { width: 44px; height: 44px; border-radius: 22px; background: var(--teal); color: #fff; font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.avatar:hover { color: #fff; background: var(--teal-dark); }
.avatar.violet { background: var(--violet); }
main { display: flex; flex-direction: column; gap: 28px; padding: 20px 32px 64px; flex: 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 16px; align-items: start; }
.grid.even { align-items: stretch; }
/* Cards of very different heights: flow them down columns so tall cards don't leave gaps beside short ones. */
.masonry { columns: 3 320px; column-gap: 16px; }
.masonry > * { break-inside: avoid; margin: 0 0 16px; }
.masonry .btn { white-space: normal; }
.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack-sm > h1 + p, .stack-sm > p.muted { max-width: 62ch; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }

.card { background: var(--card); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
a.card { text-decoration: none; color: inherit; }
a.card:hover { color: inherit; box-shadow: 0 0 0 2px var(--teal); }
.hero { background: var(--teal); color: #fff; border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.hero p { color: var(--teal-pale); }
.family { background: var(--violet-tint); color: var(--violet-ink); }
.family h2 { color: var(--violet-ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--teal); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; align-self: flex-start; }
.btn:hover { background: var(--teal-dark); color: #fff; }
.btn.light { background: #fff; color: var(--teal); } .btn.light:hover { background: var(--teal-pale); color: var(--teal-dark); }
.btn.violet { background: var(--violet); } .btn.violet:hover { background: var(--violet-ink); }
.btn.quiet { background: transparent; color: var(--teal); border: 2px solid var(--teal); } .btn.quiet:hover { background: var(--teal-tint); }
.btn.danger { background: var(--danger); } .btn.danger:hover { background: #7F2616; }
.btn.wide { align-self: stretch; }
.link { min-height: 44px; display: inline-flex; align-items: center; font-weight: 600; font-size: 14px; }

.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--gold-tint); color: var(--gold-ink); }
.pill.gold { background: var(--gold); color: var(--ink); }
.pill.white { background: #fff; color: var(--teal); }
.pill.teal { background: var(--teal-tint); color: var(--teal-dark); }
.pill.grey { background: var(--ground); color: var(--muted); }

.evidence { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.dots { display: inline-flex; gap: 3px; }
.dot { width: 9px; height: 9px; border-radius: 5px; border: 1.5px solid var(--teal); }
.dot.on { background: var(--teal); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--card); border-radius: 20px; padding: 16px; min-height: 96px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
.tile:hover { color: var(--ink); box-shadow: 0 0 0 2px var(--teal); }
.tile .num { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.1; }
.tile .name { font-size: 14px; font-weight: 600; }
.tile .sub { font-size: 12px; color: var(--muted); }
.tile.locked { background: transparent; border: 2px dashed #9AA8A6; padding: 14px; }
.num.gold { color: #B26A00; } .num.teal { color: var(--teal); } .num.violet { color: var(--violet); }

.note { font-size: 13px; line-height: 1.45; color: var(--muted); background: var(--ground); border-radius: 12px; padding: 10px 12px; }
.note strong { color: var(--ink); }
.detail { font-size: 14px; color: var(--ink-2); }
.result-big { font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 1.12; letter-spacing: -0.6px; max-width: 24ch; }
.detail { max-width: 70ch; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.facts div { background: var(--ground); border-radius: 12px; padding: 10px 12px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.scale { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.scale > .evidence { flex: 1 1 240px; }
.scale .evidence { white-space: normal; align-items: flex-start; }
.scale span.help { font-weight: 400; color: var(--muted); display: block; }

label { font-weight: 600; font-size: 14px; display: block; margin-bottom: 6px; }
input[type=email], input[type=text], input[type=file] { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line); background: #fff; font: inherit; color: var(--ink); }
input[type=file] { padding: 10px; }
input:focus { border-color: var(--teal); outline: none; }
input.code { font-family: var(--display); font-size: 28px; letter-spacing: 8px; text-align: center; }
.check { display: flex; gap: 12px; align-items: flex-start; }
.check input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--teal); flex: none; }
.check label { margin: 0; font-weight: 500; }
.error { background: var(--danger-tint); color: var(--danger); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 500; }
.ok { background: var(--teal-tint); color: var(--teal-dark); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 500; }
form.stack { gap: 16px; }
form.inline { display: inline; }

.person { display: flex; align-items: center; gap: 12px; }
.person .who { flex: 1; min-width: 0; }
.person .who strong { display: block; overflow-wrap: anywhere; }
.cmp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cmp div { background: var(--ground); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.cmp b { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.admin-row { border-top: 1px solid var(--line); padding-top: 12px; }

.auth { max-width: 420px; margin: 0 auto; padding: 48px 20px; display: flex; flex-direction: column; gap: 22px; }
.auth .brand { font-size: 26px; }

.caution { background: var(--gold-tint); }
.caution h2, .caution strong { color: #5C3700; }
.result-mid { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.2; }
.cap { text-transform: capitalize; }
.row.wrap { flex-wrap: wrap; }
.search { display: flex; gap: 8px; align-items: center; }
.search input { width: 220px; min-height: 44px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--ground); color: var(--ink); text-decoration: none; font-size: 14px; text-transform: capitalize; }
.chips a:hover { background: var(--teal-tint); color: var(--teal-dark); }
.chips a .muted { text-transform: none; margin-left: 4px; font-size: 12px; }

.btn.busy { opacity: 0.85; cursor: progress; pointer-events: none; gap: 10px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin 0.8s linear infinite; flex: none; }
.btn.quiet .spinner, .btn.light .spinner { border-color: var(--teal-tint); border-top-color: var(--teal); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

.pill.violet { background: var(--violet-tint); color: var(--violet-ink); }
.news { background: var(--gold-tint); }
.news .chips a { background: #fff; }
.dropzone.ready { border: 2px dashed #9AA8A6; border-radius: 18px; padding: 22px 18px; transition: background 0.15s, border-color 0.15s; }
.dropzone.over { background: var(--teal-tint); border-color: var(--teal); }
.drop-hint { font-family: var(--display); font-weight: 700; font-size: 18px; margin-bottom: 12px; }
.drop-file { margin-top: 12px; border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 500; }
.drop-file.ok { background: var(--teal-tint); color: var(--teal-dark); }
.drop-file.error { background: var(--danger-tint); color: var(--danger); }
h3 + .detail, .card > h3 { margin-top: 0; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; }
.chip:hover { background: var(--teal-tint); color: var(--teal-dark); }
.chip.on { background: var(--teal); color: #fff; font-weight: 600; }
details.condition { gap: 14px; }
details.condition > summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; cursor: pointer; list-style: none; min-height: 44px; }
details.condition > summary::-webkit-details-marker { display: none; }
details.condition > summary::before { content: "+"; font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--teal); width: 20px; flex: none; }
details.condition[open] > summary::before { content: "\2212"; }
details.condition[open] > summary { margin-bottom: 14px; }
.cond-name { font-family: var(--display); font-weight: 700; font-size: 19px; flex: 1 1 260px; }
.cond-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
details.condition > * + * { margin-top: 12px; }
.grid.markers { gap: 12px; }
.marker { background: var(--ground); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.marker.dim { opacity: 0.75; }
.marker .link { min-height: 32px; }

.haplo { font-family: var(--display); font-weight: 700; font-size: 56px; line-height: 1; letter-spacing: -1px; color: #fff !important; }
.chips span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--ground); font-size: 14px; }
.chips a span { min-height: 0; padding: 0; background: none; }
.chips.path span:not(:last-child)::after { content: "\2192"; margin-left: 10px; color: var(--muted); }
.chips.path span:last-child { background: var(--teal); color: #fff; font-weight: 600; }

/* Which uploaded file a result came from. Each has its own shape of label as well as colour. */
.pill.src-a { background: #E9E6FA; color: #2B2168; }
.pill.src-b { background: #FCEFD3; color: #5C3700; }
.pill.src-both { background: var(--teal-tint); color: var(--teal-dark); }
.pill.src-conflict { background: var(--danger-tint); color: var(--danger); }

nav.tabs { flex: 1; }
nav.tabs div { display: flex; gap: 4px; }
nav.tabs a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 999px; font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: none; }
nav.tabs a:hover { background: #fff; color: var(--ink); }
nav.tabs a.on { background: var(--teal-tint); color: var(--teal-dark); font-weight: 600; }

/* Phones and narrow windows: one column, tabs move to the bottom edge. */
@media (max-width: 760px) {
  h1 { font-size: 30px; line-height: 1.12; letter-spacing: -0.5px; }
  .result-big { font-size: 26px; }
  .top { padding: 20px 20px 12px; }
  main { gap: 22px; padding: 8px 20px 110px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .search { width: 100%; } .search input { flex: 1; width: auto; }
  nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: #fff; border-top: 1px solid var(--line); }
  nav.tabs div { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); }
  nav.tabs a { min-height: 48px; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 0; border-radius: 0; font-size: 12px; }
  nav.tabs a::before { content: ""; width: 28px; height: 4px; border-radius: 2px; }
  nav.tabs a:hover, nav.tabs a.on { background: transparent; }
  nav.tabs a.on { color: var(--teal); }
  nav.tabs a.on::before { background: var(--teal); }
}
