/* One stylesheet for the whole site. Plain and reference-like, in the spirit of an
   encyclopedia: serif headings, ruled sections, an infobox, numbered references. */

:root {
  --text: #202122;
  --muted: #54595d;
  --bg: #ffffff;
  --panel: #f8f9fa;
  --header: #eaecf0;
  --rule: #a2a9b1;
  --link: #3366cc;
  --visited: #795cb2;
  --proven: #e8f5e9;
  --supported: #fff8e1;
  --traditional: #fdecea;
  --open: #f1f1f1;
  /* Stronger versions for chart fills, where a pale tint would not read. */
  --proven-fill: #8cc49a;
  --supported-fill: #ecd27a;
  --traditional-fill: #eaa79f;
  --open-fill: #d4d7db;
  --serif: "Linux Libertine", "Georgia", "Times", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: #eaecf0;
    --muted: #a2a9b1;
    --bg: #101418;
    --panel: #1b1f23;
    --header: #27292d;
    --rule: #54595d;
    --link: #88a3e8;
    --visited: #a799cd;
    --proven: #1d3320;
    --supported: #3a3216;
    --traditional: #3d1f1d;
    --open: #2a2c2f;
    --proven-fill: #3f7a4c;
    --supported-fill: #8a7428;
    --traditional-fill: #8e453e;
    --open-fill: #4a4e53;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --text: #eaecf0;
  --muted: #a2a9b1;
  --bg: #101418;
  --panel: #1b1f23;
  --header: #27292d;
  --rule: #54595d;
  --link: #88a3e8;
  --visited: #a799cd;
  --proven: #1d3320;
  --supported: #3a3216;
  --traditional: #3d1f1d;
  --open: #2a2c2f;
  --proven-fill: #3f7a4c;
  --supported-fill: #8a7428;
  --traditional-fill: #8e453e;
  --open-fill: #4a4e53;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:visited { color: var(--visited); }

.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 0.6em 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em 1.4em;
  align-items: baseline;
  max-width: 1100px;
  margin: 0 auto;
}
.site-name { font: 1.35em var(--serif); color: var(--text); }
.site-name:visited { color: var(--text); }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.2em 1.1em; font-size: 0.9em; }
.site-search input, .find input {
  font: inherit;
  font-size: 0.9em;
  padding: 0.3em 0.5em;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--bg);
  color: var(--text);
  width: 12em;
}
.site-search { position: relative; margin-left: auto; }
.theme-switch {
  font: inherit; font-size: 0.8em; color: var(--muted); background: none;
  border: 1px solid var(--rule); border-radius: 2px; padding: 0.25em 0.5em; cursor: pointer;
}
.theme-switch:hover { color: var(--text); }

/* Search suggestions under a search box (suggest.js). */
.has-suggest { position: relative; }
.suggest {
  position: absolute; z-index: 20; top: 100%; left: 0; right: 0; min-width: 16em;
  list-style: none; margin: 2px 0 0; padding: 0;
  background: var(--bg); border: 1px solid var(--rule); box-shadow: 0 4px 12px rgb(0 0 0 / 0.18);
  font-size: 0.92rem;
}
.suggest a {
  display: flex; justify-content: space-between; gap: 1em; padding: 0.4em 0.6em;
  color: var(--link); text-decoration: none;
}
.suggest a:visited { color: var(--link); }
.suggest a:hover, .suggest a[aria-selected="true"] { background: var(--header); text-decoration: none; }
.suggest-years { color: var(--muted); font-size: 0.88em; white-space: nowrap; }
.suggest-more { padding: 0.35em 0.6em; color: var(--muted); font-size: 0.85em; border-top: 1px solid var(--rule); }
@media (max-width: 720px) {
  /* One swipeable row of links instead of three wrapped lines. */
  .site-header nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    white-space: nowrap;
    padding-bottom: 0.2em;
    scrollbar-width: none;
  }
  .site-search { flex: 1; margin-left: 0; }
  .site-search input { width: 100%; }
  .suggest { min-width: 0; }
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 3em;
}

h1, h2 {
  font-family: var(--serif);
  font-weight: normal;
  border-bottom: 1px solid var(--rule);
  margin: 1em 0 0.3em;
  line-height: 1.3;
}
h1 { font-size: 1.9em; }
h2 { font-size: 1.45em; margin-top: 1.4em; }
h3 { font-size: 1.05em; margin: 1.2em 0 0.2em; }

.tagline { color: var(--muted); font-size: 0.88em; margin: 0 0 1em; }

/* Infobox */
.infobox {
  float: right;
  clear: right;
  width: 22em;
  margin: 0.4em 0 1em 1.4em;
  border: 1px solid var(--rule);
  background: var(--panel);
  font-size: 0.88em;
  line-height: 1.5;
  border-collapse: collapse;
}
.infobox caption { font-weight: bold; font-size: 1.1em; padding: 0.4em; }
.infobox th, .infobox td { text-align: left; vertical-align: top; padding: 0.25em 0.6em; }
.infobox th { width: 38%; }
.infobox .section { background: var(--header); text-align: center; }

/* Contents box */
.toc {
  display: inline-block;
  border: 1px solid var(--rule);
  background: var(--panel);
  padding: 0.5em 1em 0.6em;
  font-size: 0.9em;
  margin: 0.5em 0 1em;
}
.toc strong { display: block; text-align: center; }
.toc ol { margin: 0.3em 0 0; padding-left: 1.4em; }

/* Tables */
.wikitable {
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--rule);
  font-size: 0.9em;
  margin: 1em 0;
}
.wikitable th, .wikitable td { border: 1px solid var(--rule); padding: 0.25em 0.55em; vertical-align: top; }
.wikitable th { background: var(--header); text-align: center; }
.table-scroll { overflow-x: auto; }

/* Confidence labels */
.label { white-space: nowrap; }
.label-proven { background: var(--proven); }
.label-supported { background: var(--supported); }
.label-traditional { background: var(--traditional); }
.label-open { background: var(--open); color: var(--muted); }

/* Hatnotes and notices */
.hatnote { font-style: italic; color: var(--muted); padding-left: 1.6em; margin: 0.2em 0 0.8em; }
.notice {
  border: 1px solid var(--rule);
  border-left: 8px solid #f28500;
  background: var(--panel);
  padding: 0.5em 0.8em;
  margin: 1em 0;
  font-size: 0.9em;
}

/* References */
sup.ref { font-size: 0.75em; line-height: 0; }
.needed { font-style: italic; font-size: 0.75em; white-space: nowrap; }
.references { font-size: 0.88em; }
.references li { margin-bottom: 0.3em; }
.references li:target { background: var(--supported); }

.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.8em 16px 2em;
  border-top: 1px solid var(--rule);
  font-size: 0.8em;
  color: var(--muted);
}

/* Family chart (tree.html): boxes on a stage that is moved and scaled inside the frame. */
.chart-tools { margin: 0.3em 0 0.5em; }
.chart-find { position: relative; display: flex; gap: 0.5em; flex-wrap: wrap; align-items: center; max-width: 40em; }
.chart-find input[type="search"] { flex: 1 1 14em; min-width: 0; font: inherit; padding: 0.35em 0.5em; border: 1px solid var(--rule); background: var(--bg); color: var(--text); }
.chart-hits { position: absolute; z-index: 5; top: 100%; left: 0; right: 0; list-style: none; margin: 2px 0 0; padding: 0; background: var(--bg); border: 1px solid var(--rule); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
.chart-hits:empty { display: none; }
.chart-hits button { display: block; width: 100%; text-align: left; font: inherit; padding: 0.35em 0.6em; border: none; background: none; color: var(--link); cursor: pointer; }
.chart-hits button:hover, .chart-hits button:focus { background: var(--panel); }
.chart-hits .yrs { color: var(--muted); font-size: 0.9em; }
.chart-relation { margin: 0.2em 0 0.5em; padding: 0.4em 0.7em; background: var(--supported); border-left: 3px solid var(--supported-fill); }
.chart-bar { display: flex; flex-wrap: wrap; gap: 0.4em; align-items: center; margin: 0.3em 0 0.6em; }
.chart-bar p { margin: 0 auto 0 0; }
.chart-bar button, .chart-find button:not(.chart-hits button), .chart-card button { font: inherit; font-size: 0.9em; padding: 0.25em 0.7em; border: 1px solid var(--rule); background: var(--panel); color: var(--text); cursor: pointer; }
.chart-frame { position: relative; overflow: hidden; height: 75vh; border: 1px solid var(--rule); background: var(--panel); touch-action: none; cursor: grab; user-select: none; }
.chart-frame.is-dragging { cursor: grabbing; }
.chart-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.chart-lines { position: absolute; left: 0; top: 0; overflow: visible; }
.chart-link { fill: none; stroke-width: 2; stroke: var(--rule); }
.chart-link.link-proven { stroke: var(--proven-fill); }
.chart-link.link-supported { stroke: var(--supported-fill); }
.chart-link.link-traditional { stroke: var(--traditional-fill); }
.chart-link.is-path { stroke: var(--link); stroke-width: 3.5; }
.chart-box.is-sibling { border-style: dotted; }
.chart-link.link-sibling { stroke-dasharray: 2 4; }
.chart-sibs {
  position: absolute; left: 50%; bottom: -0.7em; transform: translateX(-50%);
  font: inherit; font-size: 0.7rem; line-height: 1; padding: 0.15em 0.5em;
  border: 1px solid var(--rule, #999); border-radius: 1em; background: var(--bg, #fff); color: inherit; cursor: pointer;
}
.chart-sibs.up { bottom: auto; top: -0.7em; }
.chart-box.is-spouse { border-style: dashed; }
.link-marriage { stroke-width: 2; }
.chart-box { position: absolute; box-sizing: border-box; display: flex; align-items: center; gap: 0.5em; padding: 0.3em 0.9em 0.3em 0.4em; background: var(--bg); border: 1px solid var(--rule); border-radius: 4px; font-family: var(--sans); font-size: 13px; line-height: 1.25; cursor: pointer; }
.chart-box:hover { border-color: var(--link); }
.chart-box.is-focus { border: 2px solid var(--link); }
.chart-box.is-path { box-shadow: 0 0 0 3px var(--link); }
.chart-box.is-selected { background: var(--panel); }
.chart-pic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: 50% 25%; background: var(--panel); border: 1px solid var(--rule); fill: var(--rule); }
.chart-text { display: flex; flex-direction: column; min-width: 0; }
.chart-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.chart-yrs { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-more { position: absolute; top: 50%; width: 22px; height: 22px; margin-top: -11px; padding: 0; border: 1px solid var(--rule); border-radius: 50%; background: var(--bg); color: var(--link); font-size: 15px; line-height: 18px; cursor: pointer; }
.chart-more.right { right: -12px; }
.chart-more.left { left: -12px; }
.chart-card { position: absolute; z-index: 4; top: 10px; right: 10px; width: min(22em, calc(100% - 20px)); max-height: calc(100% - 20px); overflow: auto; box-sizing: border-box; padding: 0.7em 0.9em; background: var(--bg); border: 1px solid var(--rule); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18); font-size: 0.92em; cursor: auto; user-select: text; }
.chart-card p { margin: 0.35em 0; }
.chart-card-head { display: flex; gap: 0.6em; align-items: center; margin-right: 1.5em; }
.chart-card-head .chart-pic { width: 56px; height: 56px; }
.chart-card-close { position: absolute; top: 4px; right: 6px; border: none !important; background: none !important; font-size: 1.3em !important; line-height: 1; }
.chart-card-actions { display: flex; flex-wrap: wrap; gap: 0.6em; align-items: center; margin-top: 0.6em !important; }
.chart-key { display: flex; flex-wrap: wrap; gap: 1.2em; font-size: 0.85em; color: var(--muted); margin: 0.5em 0 0; }
.chart-key svg { vertical-align: middle; margin-right: 0.3em; }

@media (max-width: 720px) {
  .infobox { float: none; width: 100%; margin: 1em 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Static pedigree chart: oldest at the top, one box per person, the link label between. */
.pedigree { list-style: none; margin: 1em 0; padding: 0; max-width: 34em; }
.pedigree .person {
  border: 1px solid var(--rule);
  background: var(--panel);
  padding: 0.35em 0.7em;
  line-height: 1.4;
}
.pedigree .gen { color: var(--muted); font-size: 0.8em; display: inline-block; min-width: 1.6em; }
.pedigree .yrs { color: var(--muted); font-size: 0.9em; }
.pedigree .where { color: var(--muted); font-size: 0.85em; padding-left: 1.6em; }
.pedigree .link {
  font-size: 0.75em;
  margin-left: 1.5em;
  padding: 0.1em 0.6em;
  border-left: 2px solid var(--rule);
  width: max-content;
}
.pedigree .link-proven { background: var(--proven); }
.pedigree .link-supported { background: var(--supported); }
.pedigree .link-traditional { background: var(--traditional); }
.pedigree .link-open { background: var(--open); color: var(--muted); }
nav a[aria-current="page"] { color: var(--text); font-weight: bold; }

/* Family view (family.html): one household at a time. */
.find { margin: 0.8em 0; display: flex; gap: 0.6em; align-items: baseline; flex-wrap: wrap; }
.find input { width: 100%; max-width: 24em; font-size: 1em; }
.find-results { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 24em; border: 1px solid var(--rule); background: var(--panel); }
.find-results li + li { border-top: 1px solid var(--rule); }
.find-results button { font: inherit; width: 100%; text-align: left; padding: 0.45em 0.6em; background: none; border: 0; color: var(--link); cursor: pointer; }
.find-results button:hover, .find-results button:focus-visible { background: var(--header); }
.find-none { padding: 0.45em 0.6em; color: var(--muted); font-size: 0.9em; }
.family { max-width: 40em; }
.fhead { font-family: var(--serif); font-size: 1.2em; font-weight: normal; color: var(--text); border: 0; margin: 1.3em 0 0.5em; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6em; }
.fslot { display: flex; flex-direction: column; gap: 0.3em; align-items: flex-start; min-width: 0; }
.frole { font-size: 0.8em; font-weight: bold; color: var(--muted); margin: 0.6em 0 0.3em; text-transform: uppercase; letter-spacing: 0.05em; }
.fchips { display: grid; grid-template-columns: repeat(auto-fill, minmax(10em, 1fr)); gap: 0.5em; }
.fcard {
  display: flex; flex-direction: column; gap: 0.1em;
  padding: 0.5em 0.7em; border: 1px solid var(--rule); border-radius: 3px;
  background: var(--panel); color: var(--text); text-decoration: none; min-width: 0; width: 100%;
}
a.fcard:hover { background: var(--header); text-decoration: none; }
a.fcard:focus-visible { border-color: var(--link); }
a.label:hover { text-decoration: none; }
a.fcard:visited { color: var(--text); }
.fcard .fname { color: var(--link); font-weight: bold; overflow-wrap: anywhere; }
.fcard-unknown { color: var(--muted); font-style: italic; }
.fcard-focus { margin: 1em 0; padding: 0.8em 1em; border-width: 2px; background: var(--bg); }
.fcard-focus .fname { color: var(--text); font-family: var(--serif); font-size: 1.5em; font-weight: normal; }
.fyears, .fplace { font-size: 0.85em; color: var(--muted); }
.fpage { margin-top: 0.4em; font-weight: bold; }

/* Fan chart of ancestors. */
/* On a phone the fan keeps a readable size and scrolls sideways inside its frame. */
.fan-frame { max-width: 52em; }
.fan-holder { overflow-x: auto; }
.fan { width: 100%; min-width: 34em; height: auto; display: block; touch-action: pan-x pan-y; }
.fan.fan-zoomed { cursor: grab; }
.fan.fan-zoomed:active { cursor: grabbing; }
.fan-tools { display: flex; flex-wrap: wrap; gap: 0.4em 1em; align-items: center; margin: 0.3em 0 0.5em; font-size: 0.88em; }
.fan-group { display: inline-flex; align-items: center; gap: 0.3em; }
.fan-count { min-width: 6.5em; text-align: center; color: var(--muted); }
.fan-button { font: inherit; color: var(--link); background: var(--bg); border: 1px solid var(--rule); border-radius: 3px; padding: 0.15em 0.6em; cursor: pointer; }
.fan-button:hover { border-color: var(--link); }
.fan-button:disabled { color: var(--muted); cursor: default; border-color: var(--rule); }
.fan-frame:fullscreen { max-width: none; background: var(--bg); padding: 1em; overflow: auto; }
.fan-frame:fullscreen .fan { min-width: 0; max-height: calc(100vh - 5em); }
.fan path { stroke: var(--bg); stroke-width: 1.5; }
.fan a, .fan a:hover { text-decoration: none; }
.fan a[href]:hover path { opacity: 0.8; }
.fan a:focus-visible path { stroke: var(--link); stroke-width: 2.5; }
.fan-proven { fill: var(--proven-fill); }
.fan-supported { fill: var(--supported-fill); }
.fan-traditional { fill: var(--traditional-fill); }
.fan-open { fill: var(--open-fill); }
.fan-empty { fill: none; stroke: var(--rule) !important; stroke-dasharray: 3 3; }
.fan-text { font-family: var(--sans); fill: var(--text); text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.fan-centre { font-weight: bold; }

/* Record scans: the original pages a reference cites, each linking to the archive. */
.scan { margin: 0.8em 0 1.4em; padding: 0.6em; background: var(--panel); border: 1px solid var(--rule); }
.scan figcaption { font-size: 0.92em; margin-bottom: 0.5em; }
.scan-images { display: flex; gap: 0.5em; overflow-x: auto; }
.scan-images a { flex: 0 0 auto; }
.photos { display: flex; flex-wrap: wrap; gap: 1em; margin: 0.5em 0 1.5em; }
.photo { margin: 0; max-width: 16em; }
.photo img { display: block; width: auto; height: auto; max-height: 18em; max-width: 100%; border: 1px solid var(--rule); }
.photo figcaption { font-size: 0.85em; margin-top: 0.3em; }
.photo figcaption span { color: var(--muted); }
.scan-groups { display: flex; flex-wrap: wrap; gap: 0.75em 1.25em; align-items: flex-start; }
.scan-group { min-width: 0; max-width: 100%; }
.scan-group .scan-images { margin-bottom: 0.25em; }
.scan-group .scan-images img { max-height: min(12em, 40vh); }
.scan-group details.reading[open] { max-width: min(40em, 90vw); }
.scan-group .hatnote { margin: 0.25em 0 0; font-size: 0.85em; }
.scan-images img { display: block; width: auto; height: auto; max-height: min(22em, 60vh); max-width: 80vw; border: 1px solid var(--rule); background: var(--bg); }
.scan-credit { font-size: 0.85em; color: var(--muted); margin: 0.5em 0 0; }
.reading { margin-top: 0.5em; font-size: 0.92em; }
.reading summary { cursor: pointer; color: var(--link); }
.reading pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.9em; background: var(--bg); padding: 0.5em; border: 1px solid var(--rule); }

/* Homepage: the search, then the articles and the ways in as a grid of entries. */
.home-find { flex-direction: column; align-items: stretch; gap: 0.3em; max-width: 30em; }
.home-find input { max-width: none; font-size: 1.05em; padding: 0.5em 0.7em; }
.entry-grid { list-style: none; margin: 0.6em 0 1.2em; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15em, 1fr)); gap: 0.6em; }
.entry {
  display: flex; flex-direction: column; gap: 0.2em; height: 100%;
  padding: 0.7em 0.9em; border: 1px solid var(--rule); border-radius: 3px; background: var(--panel);
  color: var(--text); text-decoration: none;
}
.entry:visited { color: var(--text); }
.entry b { color: var(--link); font-family: var(--serif); font-size: 1.1em; font-weight: normal; }
.entry span { color: var(--muted); font-size: 0.9em; line-height: 1.45; }
.entry .entry-yrs { font-size: 0.85em; margin-top: -0.2em; }
.entry:hover { border-color: var(--link); text-decoration: none; }
.find-picture { margin: 0.8em 0; }
.find-picture img { display: block; max-width: 100%; max-height: 28em; width: auto; border: 1px solid var(--rule); }
.find-picture figcaption { color: var(--muted); font-size: 0.9em; margin-top: 0.3em; }
.infobox .portrait { text-align: center; padding: 0.4em; }
.infobox .portrait img { display: block; margin: 0 auto; max-width: 100%; max-height: 18em; width: auto; border: 1px solid var(--rule); }
.portrait-caption { font-size: 0.85em; margin-top: 0.3em; line-height: 1.35; }
.portrait-caption span { color: var(--muted); font-size: 0.92em; }

/* Family cards on person pages. */
.fcard .fname-plain { color: var(--text); }
.fchips-one { grid-template-columns: minmax(10em, 20em); }
.fnote { font-size: 0.9em; color: var(--muted); margin: 0.3em 0 0; }
@media (max-width: 30em) { .frow { grid-template-columns: 1fr; } }

/* Places: a tree from the country down. */
.gazetteer { max-width: 48em; }
details.place { margin: 0.15em 0 0.15em 0; }
details.place details.place { margin-left: 1.1em; }
details.place > summary { cursor: pointer; padding: 0.2em 0; }
.place-name { font-weight: bold; }
.gazetteer > details.place > summary .place-name { font-family: var(--serif); font-size: 1.2em; font-weight: normal; }
.place-count { font-size: 0.85em; color: var(--muted); }
.place-count::before { content: "("; }
.place-count::after { content: ")"; }
.place-people { margin: 0.2em 0 0.4em 1.1em; }
.suggest a { justify-content: flex-start; align-items: baseline; }
.suggest-kind { flex: 0 0 4.2em; color: var(--muted); font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.04em; }
.suggest-main { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.suggest-detail { display: block; color: var(--muted); font-size: 0.85em; }
/* The header box sits at the right: its list opens leftward, wider than the box. */
.site-search .suggest { left: auto; width: max(100%, 20em); max-width: calc(100vw - 32px); }
/* Search results page. */
.results { list-style: none; padding: 0; margin: 0.4em 0 1.2em; }
.results li { padding: 0.3em 0; border-bottom: 1px solid var(--rule); }
.results .detail { color: var(--muted); font-size: 0.9em; margin-left: 0.4em; }
/* Descendants: the sunburst's text version, nested by generation. */
.desc-list { margin: 0.4em 0 1.2em; }
.desc-list summary { cursor: pointer; color: var(--link); }
.desc-list ul { margin: 0.2em 0; padding-left: 1.2em; }
.desc-list .label { font-size: 0.78em; }
@media (prefers-reduced-motion: reduce) { .fan a path { transition: none; } }

/* Family places map. */
.map { width: 100%; height: min(70vh, 36em); border: 1px solid var(--rule); background: var(--panel); }
.map-controls { display: flex; flex-wrap: wrap; gap: 0.5em; align-items: baseline; margin: 0.6em 0; }
.map-controls button { font: inherit; padding: 0.3em 0.8em; border: 1px solid var(--rule); background: var(--panel); color: var(--link); border-radius: 3px; cursor: pointer; }
.map-controls button:hover { background: var(--header); }
#map-step { min-width: 0; overflow-wrap: anywhere; }
.map-credit { font-size: 0.8em; color: var(--muted); }
.map-popup { font-family: var(--sans); font-size: 0.85rem; color: #222; }
.map-popup ul { margin: 0.3em 0 0; padding-left: 1.1em; max-height: 10em; overflow-y: auto; }
.map-record { display: block; color: #666; font-size: 0.85em; }
.map-within { color: #666; font-size: 0.85em; }
.map-more { display: block; margin-top: 0.4em; font-size: 0.9em; }
.maplink { font: inherit; font-size: 0.75em; margin-left: 0.4em; padding: 0 0.4em; border: 1px solid var(--rule); border-radius: 2px; background: none; color: var(--link); cursor: pointer; }
.maplink:hover { background: var(--header); }
/* Family lines: the proof strip on the homepage cards, and the line pages. */
.proof-bar { display: flex; gap: 2px; margin-top: 0.5em; }
.proof-bar i { flex: 1; height: 6px; border-radius: 2px; }
.proof-bar .link-proven { background: var(--proven-fill); }
.proof-bar .link-supported { background: var(--supported-fill); }
.proof-bar .link-traditional { background: var(--traditional-fill); }
.proof-bar .link-open { background: var(--open-fill); }
.line-steps { list-style: none; padding: 0; margin: 1em 0; max-width: 36em; }
.line-steps > li { padding: 0.5em 0.8em; border: 1px solid var(--rule); border-radius: 3px; background: var(--panel); }
.line-place { display: block; font-size: 0.88em; color: var(--muted); }
.line-link { margin: 0.5em 0 -0.5em; padding: 0.3em 0 0.4em 1em; border-left: 2px solid var(--rule); font-size: 0.85em; color: var(--muted); }
.line-steps > li + li { margin-top: 0.5em; }

/* Source pages */
.crumb { font-size: 0.88em; margin: 0 0 0.2em; }
.source-kind { color: var(--muted); margin-top: 0; }
.source-where { padding: 0.5em 0.7em; background: var(--panel); border: 1px solid var(--rule); }
.source-image { margin: 1em 0 1.4em; }
.source-image img { display: block; max-width: 100%; height: auto; border: 1px solid var(--rule); }
.source-image figcaption { font-size: 0.88em; color: var(--muted); margin-top: 0.4em; }
.source-names > li { margin-bottom: 0.6em; }
.source-names ul { margin: 0.2em 0 0; }
.source-names blockquote { margin: 0.2em 0 0.3em; padding-left: 0.8em; border-left: 3px solid var(--rule); color: var(--muted); font-size: 0.92em; }
.source-list li { margin: 0.25em 0; }

/* Relationship finder */
.kin-pick label { display: block; margin-bottom: 0.3em; }
.kin-pick input { width: 100%; max-width: 24em; font: inherit; padding: 0.4em 0.6em; border: 1px solid var(--rule); background: var(--bg); color: var(--text); }
.kin-options { list-style: none; padding: 0; margin: 0.3em 0; max-width: 24em; }
.kin-options button { width: 100%; text-align: left; font: inherit; padding: 0.35em 0.6em; background: var(--panel); border: 1px solid var(--rule); border-top: 0; color: var(--text); cursor: pointer; }
.kin-options li:first-child button { border-top: 1px solid var(--rule); }
.kin-options button:hover, .kin-options button:focus { background: var(--rule); }
.kin-none { color: var(--muted); padding: 0.35em 0.6em; }
.kin-me { font-size: 0.92em; }
.kin-change { font: inherit; font-size: 0.9em; background: none; border: 1px solid var(--rule); color: var(--link); padding: 0.1em 0.5em; cursor: pointer; }
.kin-sentence { font-size: 1.15em; }
.kin-chart { margin: 0.8em 0 1.2em; }
.kin-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5em; }
.kin-and { color: var(--muted); font-size: 0.9em; }
.kin-cols { display: flex; justify-content: center; gap: 1.5em; flex-wrap: wrap; }
.kin-col { flex: 0 1 15em; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.kin-col-head { font-size: 0.8em; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.6em; }
.kin-step { display: flex; flex-direction: column; align-items: center; width: 100%; }
.kin-link { border-left: 2px solid var(--rule); padding: 0.35em 0 0.35em 0.5em; margin-left: 0.5em; font-size: 0.8em; align-self: center; }
.kin-card { display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%; max-width: 15em; box-sizing: border-box; padding: 0.4em 0.6em; background: var(--panel); border: 1px solid var(--rule); color: var(--text); text-decoration: none; }
a.kin-card:hover { background: var(--rule); text-decoration: none; }
.kin-top .kin-card { width: auto; min-width: 10em; }
.kin-you { border: 2px solid var(--link); }
.kin-top .kin-step { width: auto; }
/* A close button big enough to hit with a thumb. */
.maplibregl-popup-close-button { font-size: 1.5em; width: 1.6em; height: 1.6em; line-height: 1; color: #444; }
.maplibregl-popup-content { padding-top: 1.2em; }
.map-kind { display: block; font-size: 0.75em; text-transform: uppercase; letter-spacing: 0.05em; color: #8a5a2b; }
/* Card pictures: a face or a page of the record, cropped to one shape. */
.entry-pic { display: block; width: calc(100% + 1.8em); max-width: none; margin: -0.7em -0.9em 0.5em; aspect-ratio: 16 / 10; object-fit: cover; object-position: 50% 20%; background: var(--panel); border-bottom: 1px solid var(--rule); }
.entry:has(.entry-pic) { overflow: hidden; }

/* Family land under the map. */
.land-panel { font-family: var(--sans); font-size: 0.9em; border: 1px solid var(--rule); border-top: 0; padding: 0.6em 0.8em; margin: 0 0 1em; }
.land-head { margin: 0 0 0.4em; display: flex; gap: 0.6em; align-items: center; flex-wrap: wrap; }
.land-go { font: inherit; font-size: 0.9em; cursor: pointer; }
.land-row { display: flex; gap: 0.6em; align-items: center; margin: 0.3em 0; }
.land-row input[type="range"] { flex: 1; min-width: 0; }
.land-year { font-weight: bold; min-width: 3em; }
.land-key { list-style: none; padding: 0; margin: 0.3em 0; display: flex; flex-wrap: wrap; gap: 0.3em 1em; }
.land-swatch { display: inline-block; width: 0.9em; height: 0.9em; margin-right: 0.35em; vertical-align: -0.1em; border-radius: 2px; }
.land-note { color: var(--muted); margin: 0.3em 0 0; }
.map-source { font-size: 0.9em; margin: 0.3em 0 0; }
.land-plats { margin: 0.2em 0 0; padding-left: 1.2em; }
.map-find { display: flex; gap: 0.4em; align-items: center; flex-wrap: wrap; margin: 0.5em 0; font-family: var(--sans); }
.map-find input { flex: 1; min-width: 0; max-width: 24em; font: inherit; padding: 0.3em 0.5em; }
.map-find button { font: inherit; cursor: pointer; }
.map-find-status { color: var(--muted); font-size: 0.9em; }
.land-held { list-style: none; padding: 0; margin: 0.4em 0; }
.land-held li { margin: 0.2em 0; }
.land-item { font: inherit; background: none; border: 0; padding: 0.15em 0; color: var(--link, #3366cc); cursor: pointer; text-align: left; }
.land-item:hover { text-decoration: underline; }

/* The nav link for the section the reader is in. */
.site-header nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}
.page-tools { margin: -0.4em 0 0.8em; font-size: 0.9em; }

.results.mentions .snippet { display: block; }
.results.mentions mark { background: var(--supported-fill, #fe6); color: inherit; padding: 0 0.1em; }

/* Household chapters: one per place, the family's story above the facts. */
.chapter { margin-top: 1.6em; }
.chapter-years { font-weight: normal; color: var(--muted, #666); font-size: 0.85em; margin-left: 0.4em; }
.story-todo { font-style: italic; color: var(--muted, #666); margin: 0.3em 0 0.6em; }

/* Home page fan chart. */
.fan-figure { margin: 1em 0 1.5em; }
#fan { display: block; width: 100%; height: auto; max-width: 960px; margin: 0 auto; touch-action: manipulation; }
.fan-root { fill: var(--header); }
.fan-wedge { stroke: var(--bg); stroke-width: 0.8; }
.fan-wedge.fan-proven { fill: var(--proven-fill); }
.fan-wedge.fan-supported { fill: var(--supported-fill); }
.fan-wedge.fan-traditional { fill: var(--traditional-fill); }
.fan-wedge.fan-open { fill: var(--open-fill); }
.fan-tendril { fill: none; stroke-width: 1; stroke-linecap: round; }
.fan-tendril.fan-proven { stroke: var(--proven-fill); }
.fan-tendril.fan-supported { stroke: var(--supported-fill); }
.fan-tendril.fan-traditional { stroke: var(--traditional-fill); }
.fan-tendril.fan-open { stroke: var(--rule); opacity: 0.55; }
.fan-hit { fill: var(--text); pointer-events: none; }
#fan a:hover .fan-wedge, #fan a:focus .fan-wedge { stroke: var(--text); stroke-width: 1.5; }
.fan-animate .fan-gen { animation: fan-in 450ms ease-out both; }
.fan-animate .fan-reach { transform-box: fill-box; transform-origin: center; animation: fan-grow 1400ms ease-out both; }
@keyframes fan-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fan-grow { from { transform: scale(0.62); } to { transform: scale(1); } }
.fan-figure figcaption { text-align: center; color: var(--muted); font-size: 0.9em; margin-top: 0.4em; min-height: 2.6em; }
#fan-info { display: block; color: var(--text); }
.fan-key { text-align: center; font-size: 0.85em; margin: 0.3em 0 0; }
.fan-key span { display: inline-block; margin: 0 0.5em; }
.fan-key span::before { content: ""; display: inline-block; width: 0.9em; height: 0.9em; margin-right: 0.3em; vertical-align: -0.1em; border-radius: 2px; }
.fan-key .key-proven::before { background: var(--proven-fill); }
.fan-key .key-supported::before { background: var(--supported-fill); }
.fan-key .key-traditional::before { background: var(--traditional-fill); }
.fan-key .key-open::before { background: var(--open-fill); }

/* Section links: a small "#" after each section heading, shown on hover (always faintly on touch screens). */
.anchor { margin-left: 0.35em; font-size: 0.7em; color: var(--muted); text-decoration: none; opacity: 0; }
h2:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--link); }
@media (hover: none) { .anchor { opacity: 0.45; } }
h2[id] { scroll-margin-top: 1em; }

/* Family cards with a portrait: a square head shot filling the card's left side. */
.fcard-pic { flex-direction: row; align-items: stretch; gap: 0; padding: 0; overflow: hidden; }
.fcard-pic .ftext { display: flex; flex-direction: column; justify-content: center; gap: 0.1em; min-width: 0; padding: 0.5em 0.7em; }
.fpic { width: 6.5em; height: 6.5em; min-height: 100%; align-self: stretch; object-fit: cover; object-position: 50% 20%; border-right: 1px solid var(--rule); flex: 0 0 auto; display: block; }
.fchips:has(.fcard-pic) { grid-template-columns: repeat(auto-fill, minmax(15em, 1fr)); }
.fcard-pic { min-height: 6.5em; }

/* Home page: one row of four in each section, the rest a click away. */
.home-find ~ .entry-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-find ~ .entry-grid:not(.all) > li:nth-child(n+5) { display: none; }
@media (max-width: 48em) {
  .home-find ~ .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-find ~ .entry-grid:not(.all) > li:nth-child(n+3) { display: none; }
}
.show-all { font: inherit; color: var(--link); background: none; border: 0; padding: 0; cursor: pointer; }
.show-all:hover { text-decoration: underline; }

/* A captioned photo of a place, on the home and farm pages. */
.place-photo { margin: 1em 0 1.5em; max-width: 40em; }
.place-photo img { display: block; max-width: 100%; height: auto; border: 1px solid var(--rule); }
.place-photo figcaption { color: var(--muted); font-size: 0.85em; margin-top: 0.4em; }
.fpic-none { display: flex; align-items: center; justify-content: center; background: var(--header); }
.fpic-none svg { width: 60%; height: 60%; fill: var(--rule); }

/* The name in the person's own script, under the page heading. */
.native-name { margin: -0.4rem 0 0.6rem; font-size: 1.25rem; color: var(--muted, #555); }
.unlinked-tag { font-size: 0.75em; color: var(--muted); border: 1px solid var(--rule); border-radius: 3px; padding: 0 0.35em; white-space: nowrap; vertical-align: 0.1em; }
.hatnote.unlinked { border-left: 3px solid var(--rule); padding-left: 0.7em; }

/* A translator's note or credit under a translation: not the record's words. */
.reading-note { font-size: 0.85em; font-style: italic; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 0.4em; }

/* Sources searched: one entry per record set, tagged with what it showed. */
.search-count, .search-lines { color: var(--muted); }
.search-list { list-style: none; padding: 0; margin: 0 0 1.5em; }
.search-list .search { border-top: 1px solid var(--header); padding: 0.6em 0; }
.search-list h3 { font-family: var(--sans); font-size: 1em; margin: 0 0 0.2em; }
.search-list p { margin: 0.2em 0; }
.search-meta, .search-records { font-size: 0.9em; color: var(--muted); }
.search-tag { font-size: 0.75em; font-weight: normal; border: 1px solid var(--rule); border-radius: 3px; padding: 0 0.35em; white-space: nowrap; vertical-align: 0.1em; }
.search-tag.found { background: var(--proven); }
.search-tag.partly { background: var(--supported); }
.search-tag.nothing { background: var(--open); }
