:root {
  --bg: #f7f4ee;
  --card: #fffdf9;
  --ink: #23201b;
  --muted: #6f685d;
  --line: #e2dccf;
  --accent: #2f5d43;
  --accent-ink: #fff;
  --accent-soft: #e4eee6;
  --f: #9b4d6b;
  --m: #3c6488;
  --danger: #a33a2c;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171a17;
    --card: #20241f;
    --ink: #ece8df;
    --muted: #a39d90;
    --line: #353a33;
    --accent: #7fb894;
    --accent-ink: #10180f;
    --accent-soft: #263329;
    --f: #d792ad;
    --m: #8fb4d6;
    --danger: #e57d6c;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }
h1 { font-size: 1.9rem; margin: .2em 0 .4em; }
h2 { font-size: 1.25rem; margin: 1.6em 0 .5em; }
code { font-size: .9em; background: var(--accent-soft); padding: .05em .35em; border-radius: 4px; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 5; }
.top nav { display: flex; min-width: 0; }
.top nav a:first-child { flex-shrink: 0; }
.top nav a { margin-left: 18px; text-decoration: none; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.brand { display: flex; gap: 8px; align-items: center; text-decoration: none; color: var(--ink); font-family: var(--serif); font-size: 1.2rem; }
.brand b { color: var(--accent); font-weight: 600; }
.leaf { width: 24px; height: 24px; color: var(--accent); }
main { max-width: 980px; margin: 0 auto; padding: 20px 16px 60px; }
main.wide { max-width: 1400px; }
.foot { display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; padding: 18px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.crumbs .sep { margin: 0 6px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.flash { background: var(--accent-soft); border: 1px solid var(--line); padding: 10px 14px; border-radius: 8px; }
.flash.error { border-color: var(--danger); color: var(--danger); background: transparent; }
.empty { color: var(--muted); padding: 24px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; }

input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); }
input[type=checkbox] { width: auto; }
input[type=file] { padding: 6px; }
label { display: block; font-size: .875rem; color: var(--muted); margin: 0 0 10px; }
label > input, label > select, label > textarea { margin-top: 3px; color: var(--ink); }
label.check { display: flex; gap: 8px; align-items: center; margin-top: 22px; color: var(--ink); }
/* `button { display }` below would otherwise beat the browser's own rule for the hidden attribute. */
[hidden] { display: none !important; }
button, .btn { display: inline-block; padding: 8px 14px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); border-radius: 7px; cursor: pointer; text-decoration: none; font-size: .95rem; white-space: nowrap; }
.btn { background: transparent; color: var(--accent); }
.btn.on { background: var(--accent); color: var(--accent-ink); }
button.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; }
button.x { background: none; border: 0; color: var(--muted); padding: 0 4px; font-size: 1.1rem; line-height: 1; }
button.x:hover { color: var(--danger); }
form.inline { display: inline; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > input { flex: 1 1 200px; }
.grid2, .grid3 { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
.grid3 { grid-template-columns: repeat(3, 1fr); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 14px 0; }
.panel > summary { cursor: pointer; font-weight: 600; }
.panel[open] > summary { margin-bottom: 10px; }
details.mini > summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.split .panel h2 { margin-top: 0; }

.hero { padding: 30px 0 10px; }
.hero h1 { font-size: 2.6rem; max-width: 16ch; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.signin { max-width: 520px; margin-top: 22px; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; margin-top: 40px; }
.features div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px 18px 10px; }
.features h3 { margin-bottom: .2em; }

.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cards a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px 10px; text-decoration: none; color: var(--ink); height: 100%; }
.cards a:hover { border-color: var(--accent); }
.cards h3 { margin-bottom: 0; }
.titlebar { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--muted); }
.stats b { color: var(--ink); font-size: 1.1rem; }
.search { display: flex; gap: 8px; margin: 12px 0; }
.surnames { display: flex; flex-wrap: wrap; gap: 6px; }
.surnames a { text-decoration: none; padding: 3px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--ink); font-size: .9rem; background: var(--card); }
.surnames a span { color: var(--muted); font-size: .8rem; }
table.people { width: 100%; border-collapse: collapse; margin: 10px 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.people th, table.people td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.people th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.people tr:last-child td { border-bottom: 0; }

.pl { text-decoration: none; font-weight: 500; }
.pl .yrs { color: var(--muted); font-weight: 400; font-size: .85em; }
.pl.sex-F { color: var(--f); }
.pl.sex-M { color: var(--m); }
.tag { font-size: .78rem; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; }

.person-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.person-head h1 { margin-bottom: 0; }
.person-head p { margin: .3em 0; }
.portrait { width: 140px; height: 160px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.portrait.none { display: grid; place-items: center; font-family: var(--serif); font-size: 2.6rem; color: var(--muted); }
.portrait.sex-F { color: var(--f); }
.portrait.sex-M { color: var(--m); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cols3 .panel { margin: 6px 0; }
.line { margin: .3em 0 .5em; }
.person-head .actions { margin-top: 8px; }
.union { border-left: 3px solid var(--line); padding-left: 12px; margin-bottom: 10px; }
.union ul { margin: 4px 0; }
.timeline { list-style: none; padding: 0; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li { position: relative; padding: 4px 0 10px 18px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline .when { display: inline-block; min-width: 110px; color: var(--muted); font-size: .9rem; }
.notes { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; font-family: var(--serif); font-size: 1.05rem; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photos figure { margin: 0; }
.photos img { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.photos figcaption { font-size: .85rem; color: var(--muted); }

.chart { overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.pedigree .box rect { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
.pedigree .box.sex-M rect { stroke: var(--m); }
.pedigree .box.sex-F rect { stroke: var(--f); }
.pedigree .box.empty rect { stroke-dasharray: 4 4; fill: none; }
.pedigree a:hover rect { fill: var(--accent-soft); }
.pedigree .nm { fill: var(--ink); font: 600 14px var(--sans); }
.pedigree .yr { fill: var(--muted); font: 12px var(--sans); }
.pedigree .edge { fill: none; stroke: var(--line); stroke-width: 1.5; }
.desc ul { list-style: none; margin: 4px 0 4px 18px; padding-left: 14px; border-left: 2px solid var(--line); }
.desc .amp { color: var(--muted); }
.relate select { flex: 1 1 220px; width: auto; }
.answer .big { font-size: 1.35rem; font-family: var(--serif); }
.path { color: var(--muted); }
.copy { display: flex; gap: 8px; }
.badge { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .75rem; line-height: 1.4em; text-align: center; vertical-align: 1px; }
.facts { border-collapse: collapse; margin: 8px 0 16px; }
.facts th { text-align: left; font-weight: 400; color: var(--muted); padding: 4px 18px 4px 0; vertical-align: top; text-transform: capitalize; white-space: nowrap; }
.facts td { padding: 4px 0; overflow-wrap: anywhere; }
.threads { list-style: none; padding: 0; margin: 0 0 16px; }
.threads li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.threads li a { text-decoration: none; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.threads li.unread b { color: var(--accent); }
.messages { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.messages li { max-width: min(80%, 560px); padding: 8px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); overflow-wrap: anywhere; }
.messages li.mine { align-self: flex-end; background: var(--accent-soft); }
.messages li .small { display: block; margin-top: 2px; }
.invite-nudge { margin: 8px 0; }
.invite-nudge .row input { flex: 1 1 200px; }
details.mini.invite-nudge summary { color: var(--muted); font-size: .9rem; cursor: pointer; }
blockquote.notes { margin: 8px 0; padding: 6px 14px; border-left: 3px solid var(--line); }

@media (max-width: 720px) {
  .split, .cols, .cols3 { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 2rem; }
  table.people td:nth-child(3), table.people th:nth-child(3) { display: none; }
  .top nav a { margin-left: 12px; }
  .portrait { width: 100px; height: 115px; }
}

/* the Moshpit ring bar (pit.world/ring), on every page */
.ring-bar { display: flex; align-items: center; gap: 4px 16px; padding: 6px 16px; border-bottom: 1px solid var(--line); background: var(--card); font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.ring-bar::-webkit-scrollbar { display: none; }
.ring-bar a { color: var(--muted); text-decoration: none; }
.ring-bar a:hover, .ring-bar a:focus-visible { color: var(--accent); text-decoration: underline; }
.ring-bar .ring-home { color: var(--accent); font-weight: 700; }
.ring-bar .ring-sites { display: inline-flex; gap: 12px; padding: 0 12px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.ring-bar [aria-current='page'] { color: var(--ink); }
@media (max-width: 640px) { .ring-bar .ring-sites, .ring-bar .ring-home span { display: none; } }

/* crawlproof ad units: a cross-origin frame, sized to its format. */
.ad-unit { margin: 24px auto; display: flex; justify-content: center; }
.ad-unit iframe { border: 0; display: block; background: transparent; }
.ad-text_link { max-width: 960px; padding: 0 16px; }
.ad-text_link iframe { width: 100%; height: 40px; }
.ad-banner_300x250 iframe { width: 300px; height: 250px; }
@media (max-width: 340px) { .ad-banner_300x250 { margin-inline: calc(50% - 50vw); } }
ul.plain { list-style: none; padding: 0; }
/* Businesses: square-ish, so a company never looks like a person. */
.portrait.biz, .portrait.none.biz { width: 170px; height: 120px; border-radius: 4px; }
.pl.biz { font-style: italic; }
