/* Rodokmen – visual language shared with rakvice.jakubcabal.cz
   (Source Sans 3 text, Source Serif 4 headings, red from the Rakvice coat of arms). */

@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("fonts/source-sans-3-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Sans 3"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url("fonts/source-sans-3-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url("fonts/source-sans-3-latin-ext-wght-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("fonts/source-serif-4-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ------------------------------------------------------------ tokens */
:root {
  --bg: #f7f5f1; --surface: #ffffff; --surface-2: #f0ece5;
  --ink: #1f1c18; --ink-2: #3b362f; --muted: #6c645a;
  --line: #e2dcd2; --line-strong: #cfc6b8;
  --accent: #9b1d22; --accent-hover: #7b1418; --accent-soft: #f6e7e5; --accent-ink: #ffffff;
  --gold: #a87b1f;
  --m: #4d6a8a; --m-soft: #e6edf4; --f: #9d4a60; --f-soft: #f5e6ea; --u: #7a7166; --u-soft: #eeeae3;
  --shadow: 0 1px 2px rgba(40, 30, 20, .06), 0 3px 10px rgba(40, 30, 20, .05);
  --shadow-lg: 0 2px 4px rgba(40, 30, 20, .06), 0 10px 30px rgba(40, 30, 20, .08);
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --header-h: 58px; --container: 1200px; --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161411; --surface: #1e1b17; --surface-2: #27231e;
    --ink: #ece6dc; --ink-2: #d4cdc1; --muted: #a39a8d;
    --line: #322d27; --line-strong: #463f36;
    --accent: #ec7f75; --accent-hover: #f6a39b; --accent-soft: #3a2120; --accent-ink: #1b1110;
    --gold: #d6a84a;
    --m: #8fb0d3; --m-soft: #1f2a35; --f: #e195aa; --f-soft: #372229; --u: #a39a8d; --u-soft: #2a2621;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 3px 10px rgba(0, 0, 0, .25);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161411; --surface: #1e1b17; --surface-2: #27231e;
  --ink: #ece6dc; --ink-2: #d4cdc1; --muted: #a39a8d;
  --line: #322d27; --line-strong: #463f36;
  --accent: #ec7f75; --accent-hover: #f6a39b; --accent-soft: #3a2120; --accent-ink: #1b1110;
  --gold: #d6a84a;
  --m: #8fb0d3; --m-soft: #1f2a35; --f: #e195aa; --f-soft: #372229; --u: #a39a8d; --u-soft: #2a2621;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 3px 10px rgba(0, 0, 0, .25);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--sans);
  min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .15em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 650; line-height: 1.2; color: var(--ink); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
main.wrap { flex: 1; padding-top: 22px; padding-bottom: 56px; }
.count { display: inline-block; font: 600 .75rem/1.6 var(--sans); color: var(--muted); background: var(--surface-2);
  border-radius: 999px; padding: 0 .5em; vertical-align: .15em; margin-left: .2em; }

/* ------------------------------------------------------------ header */
.site-header { position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line); }
.site-header__inner { max-width: var(--container); margin: 0 auto; height: 100%; padding: 0 20px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand:hover { color: var(--ink); }
.brand img { flex: none; width: auto; height: 36px; }
.brand__text { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.brand__title { font: 650 1.15rem/1.2 var(--serif); white-space: nowrap; }
.brand__sub { font: italic 400 .95rem/1.2 var(--serif); color: var(--muted); white-space: nowrap; }
.topnav { display: flex; gap: 2px; margin-left: 8px; }
.topnav a { color: var(--ink-2); text-decoration: none; font-size: .95rem; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.topnav .nav-search { display: none; }   /* the header search box is right next to it */
.topnav a:hover { background: var(--surface-2); color: var(--ink); }
.header-search { position: relative; margin-left: auto; width: min(340px, 32vw); }
.header-search input { width: 100%; height: 38px; padding: 0 36px 0 34px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: .93rem; }
.header-search input::placeholder { color: var(--muted); }
.header-search input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.header-search__icon { position: absolute; left: 12px; top: 10px; color: var(--muted); pointer-events: none; }
.header-search__kbd { position: absolute; right: 12px; top: 9px; font: 11px/18px var(--mono); padding: 0 5px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--muted); }
.page-home .header-search, .page-search .header-search { display: none; }
.page-home .theme-toggle, .page-search .theme-toggle { margin-left: auto; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.search-link { display: none; }
.menu-toggle { display: none; }
.mnav { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-lg); padding: 6px 0; }
.mnav[hidden] { display: none; }
.mnav a { display: block; padding: 11px 20px; color: var(--ink); text-decoration: none; font-weight: 600; }
.mnav a:hover, .mnav a:focus { background: var(--surface-2); color: var(--accent); }
.mnav .mnav__parent { font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line); }
.page-home .crumbs { margin: 0; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

/* live search dropdown */
.live { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; list-style: none; margin: 0;
  max-height: min(70vh, 520px); overflow-y: auto; min-width: 300px; }
.live li a { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.live li a:hover, .live li a[aria-selected="true"] { background: var(--surface-2); }
.live .face { width: 34px; height: 34px; font-size: .75rem; }
.live__name { font-weight: 600; display: block; line-height: 1.2; }
.live__meta { font-size: .85rem; color: var(--muted); display: block; line-height: 1.25; }
.live__more { display: block; padding: 6px 8px; font-size: .9rem; }
.live__empty { padding: 8px; color: var(--muted); font-size: .92rem; }

/* ------------------------------------------------------------ crumbs, titles */
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.page-title { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 6px; }
.lead { color: var(--ink-2); font-size: 1.08rem; margin: 0 0 18px; }
.h-sec { font-size: 1.4rem; margin: 0 0 12px; }
.h-grp { font-size: 1.12rem; margin: 26px 0 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.h-grp:first-child { margin-top: 4px; }

/* ------------------------------------------------------------ faces & person cards */
.face, .mono { flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; background: var(--u-soft); color: var(--u); font: 650 .9rem/1 var(--serif); letter-spacing: .02em; }
.face--m, .mono--m { background: var(--m-soft); color: var(--m); }
.face--f, .mono--f { background: var(--f-soft); color: var(--f); }
img.face { box-shadow: inset 0 0 0 1px var(--line); border: 2px solid var(--surface); outline: 1px solid var(--line); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.pcard { display: flex; align-items: center; gap: 11px; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); min-width: 0;
  transition: border-color .15s, transform .15s; }
a.pcard:hover { border-color: var(--line-strong); color: var(--ink); transform: translateY(-1px); }
a.pcard:hover .pcard__name { color: var(--accent); }
.pcard__body { display: flex; flex-direction: column; min-width: 0; }
.pcard__role { font: 600 .72rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pcard__name { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.pcard__meta { font-size: .87rem; color: var(--muted); line-height: 1.3; }
.pcard--private { opacity: .75; }

/* ------------------------------------------------------------ medallion */
.medallion { position: relative; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 26px; padding: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.medallion::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--u); }
.medallion--m::before { background: var(--m); }
.medallion--f::before { background: var(--f); }
.medallion__photo { display: block; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: var(--surface-2); align-self: start;
  box-shadow: 0 0 0 1px var(--line); }
.medallion__photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
a.medallion__photo:hover img { transform: scale(1.02); }
.medallion__photo--empty { display: grid; place-items: center; aspect-ratio: 1; background: transparent; box-shadow: none; }
.medallion__photo--empty .mono { width: 100%; height: auto; aspect-ratio: 1; font-size: 2rem; }
.medallion--nophoto { grid-template-columns: 104px minmax(0, 1fr); }
.fs__marr .i-rings { color: var(--accent); vertical-align: -2px; margin-right: 2px; }
.medallion__body { min-width: 0; }
.eyebrow { display: inline-block; font: 600 .78rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); text-decoration: none; margin-bottom: 4px; }
.medallion h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin: 0 0 6px; }
.medallion__names { margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-2); font-family: var(--serif); font-style: italic; }
.aka__lab { font: 600 .72rem/1 var(--sans); font-style: normal; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: 2px; }
.medallion__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.medallion__ids { font-size: .8rem; color: var(--muted); white-space: nowrap; margin-left: auto; font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 4px 0 0; }
.tile { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 10px 14px 11px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; }
.tile__lab { font: 600 .72rem/1.4 var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.tile__lab .sym { font: 700 .95rem/1 var(--serif); color: var(--accent); margin-right: 1px; }
.tile--death .tile__lab .sym { color: var(--ink-2); }
.tile__val { font: 650 1.2rem/1.3 var(--serif); color: var(--ink); }
.tile__place { font-size: .95rem; line-height: 1.3; color: var(--ink-2); }
.tile__addr { margin-top: 2px; }
.tile__addr .addr { font-size: .85rem; }
.med-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 18px; align-items: start; margin-top: 4px; }
.med-grid--nofacts { grid-template-columns: minmax(0, 1fr); }
.med-grid .tiles { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 0; }
.med-facts { margin: 0; padding: 2px 0 2px 18px; border-left: 1px solid var(--line); display: grid; gap: 7px; }
.mf { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: .95rem; line-height: 1.35; }
.mf dt { font: 600 .72rem/1.4 var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.mf dd { margin: 0; }
.mf b { font: 650 1.05rem/1.2 var(--serif); }
.plc { color: inherit; text-decoration-color: var(--line-strong); }
.addr { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: .92rem; text-decoration-color: var(--line-strong); }
.addr svg { color: var(--muted); }
a.addr:hover { color: var(--accent); }
.private-note { color: var(--muted); font-style: italic; }

/* ------------------------------------------------------------ story */
.notes { margin-top: 18px; }
.prose { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 26px; box-shadow: var(--shadow); margin-bottom: 16px; }
.story .prose { font-size: 1.04rem; line-height: 1.65; }
.story .prose > p:first-of-type::first-letter { font: 650 3.1em/0.9 var(--serif); float: left; margin: .06em .08em 0 0; color: var(--accent); }
.prose p, .prose ul, .prose ol { margin: 0 0 .85em; max-width: 46rem; }
.prose h2 { font-size: 1.25rem; margin: 1.3em 0 .5em; }
.prose h3 { font-size: 1.1rem; margin: 1.2em 0 .4em; }
.prose h4 { font-size: 1rem; margin: 1em 0 .3em; }
.prose > :last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); }
.fn { font-size: .7em; color: var(--accent); }
.notes ul { margin: 0; padding-left: 1.2em; }
.table-wrap { overflow-x: auto; margin: .5em 0 1em; border: 1px solid var(--line); border-radius: 8px; }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: .88rem; }
.table-wrap th, .table-wrap td { padding: 5px 9px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.table-wrap th { background: var(--surface-2); font-weight: 600; }
.table-wrap tr:last-child td { border-bottom: 0; }
a.ext { white-space: nowrap; }

/* ------------------------------------------------------------ tabs */
.tabs { margin-top: 10px; }
.tabs__nav { display: none; }
.js .tabs__nav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none;
  position: sticky; top: var(--header-h); z-index: 4; background: var(--bg); }
.tabs__nav a { flex: none; padding: 10px 14px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs__nav a:hover { color: var(--ink); }
.tabs__nav a[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.panel { margin-bottom: 30px; }
.panel__title { font-size: 1.4rem; margin: 0 0 8px; }
.js .panel__title { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.js .panel[hidden], .js .tabs:not(.is-ready) .panel ~ .panel { display: none; }
/* split layout: tabs on the left, family column on the right (wide screens) */
.tab--side { display: block; }
@media (min-width: 1000px) {
  .js .tabs--split { display: grid; grid-template-columns: minmax(0, 1fr) 330px; grid-template-rows: auto 1fr; column-gap: 28px; align-items: start; }
  .js .tabs--split > .tabs__nav { grid-column: 1; grid-row: 1; }
  .js .tabs--split > .panel { grid-column: 1; grid-row: 2; }
  .js .tabs--split > .panel--side { grid-column: 2; grid-row: 1 / span 2; display: block !important; margin-top: 0; }
  .js .tabs--split .tab--side { display: none; }
  .js .panel--side > .panel__title { position: static !important; width: auto; height: auto; clip: auto;
    font-size: 1.15rem; margin: 6px 0 10px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
}

/* family column */
.panel--side .fs, .panel--side .fs-fam { margin-bottom: 14px; }
.fs-fam { padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.fs-fam .fs { margin-bottom: 10px; }
.fs__t { font: 600 .74rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 6px; display: flex; align-items: baseline; gap: 4px; }
.fs__marr { margin: -2px 0 7px; font-size: .86rem; color: var(--ink-2); }
.prose > h2:first-child { margin-top: 0; }
.fs__none { margin: 0; font-size: .9rem; }
.cards--list { grid-template-columns: minmax(0, 1fr); gap: 5px; }
.cards--list .pcard { padding: 6px 10px; gap: 10px; box-shadow: none; }
.cards--list .face { width: 36px; height: 36px; font-size: .78rem; }
.cards--list .pcard__name { font-size: .96rem; }
.cards--list .pcard__meta { font-size: .82rem; }
.fs--kids { padding-left: 14px; border-left: 2px solid var(--line-strong); margin-left: 6px; }
.pcard--me { background: var(--accent-soft); border-color: var(--accent); }
.pcard--me .pcard__role { color: var(--accent); }

/* ------------------------------------------------------------ pedigree */
.ped-scroll { overflow-x: auto; padding: 6px 2px 14px; margin: 0 -2px; }
.ped { display: inline-block; min-width: 100%; }
.ped-node { display: flex; align-items: center; }
.ped-parents { display: flex; flex-direction: column; justify-content: center; position: relative; padding-left: 14px; }
.ped-parents::before { content: ""; position: absolute; left: 0; top: 50%; width: 14px; border-top: 1px solid var(--line-strong); }
.ped-parents > .ped-node { position: relative; padding: 4px 0 4px 14px; }
.ped-parents > .ped-node::before { content: ""; position: absolute; left: 0; top: 50%; width: 14px; border-top: 1px solid var(--line-strong); }
.ped-parents > .ped-node::after { content: ""; position: absolute; left: 0; border-left: 1px solid var(--line-strong); }
.ped-parents > .ped-node:first-child::after { top: 50%; bottom: 0; }
.ped-parents > .ped-node:last-child::after { top: 0; bottom: 50%; }
.ped-parents > .ped-node:only-child::after { display: none; }
.pbox { display: flex; flex-direction: column; width: 158px; flex: none; padding: 7px 11px; background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--u); border-radius: 8px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); line-height: 1.25; }
.pbox--m { border-left-color: var(--m); }
.pbox--f { border-left-color: var(--f); }
a.pbox:hover .pbox__name { color: var(--accent); }
.pbox__name { font-weight: 600; font-size: .93rem; }
.pbox__meta { font-size: .8rem; color: var(--muted); }
.pbox--self { background: var(--accent-soft); border-color: var(--accent); border-left-color: var(--accent); }
.pbox--empty { color: var(--muted); font-size: .85rem; font-style: italic; border-style: dashed; box-shadow: none; background: transparent; }

/* descendants */
.desc-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 16px; box-shadow: var(--shadow); overflow-x: auto; }
.dt__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.dt__gens { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .9rem; color: var(--muted); }
.dt__gens b { font: 650 1.05rem/1 var(--serif); color: var(--accent); margin-right: 2px; }
.dt__tools { display: flex; gap: 6px; }
.dt__tools button { font: 600 .8rem/1 var(--sans); padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--ink-2); cursor: pointer; }
.dt__tools button:hover { border-color: var(--accent); color: var(--accent); }
.dt { min-width: 0; }
.dt__kids { list-style: none; margin: 0; padding: 0 0 0 17px; }
.dt__kids > li { position: relative; padding: 3px 0 3px 22px; }
.dt__kids > li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1.5px solid var(--line-strong); }
.dt__kids > li:last-child::before { bottom: auto; height: 21px; }
.dt__kids > li::after { content: ""; position: absolute; left: 0; top: 21px; width: 18px; border-top: 1.5px solid var(--line-strong); }
.dt__node > .dt__kids { margin-left: 26px; }
.dt__row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 36px; }
div.dt__row { padding-left: 26px; }
summary.dt__row { list-style: none; cursor: pointer; }
summary.dt__row::-webkit-details-marker { display: none; }
.dt__tog { flex: none; width: 20px; height: 20px; margin-right: -4px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-2); }
.dt__tog::before { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); margin-left: -2px; transition: transform .15s; }
details[open] > summary .dt__tog::before { transform: rotate(45deg); margin: -3px 0 0; }
summary.dt__row:hover .dt__tog { background: var(--accent-soft); color: var(--accent); }
.dt__card { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); text-decoration: none; color: var(--ink); max-width: 100%; }
.dt__card .face { width: 28px; height: 28px; font-size: .66rem; border-width: 1px; }
a.dt__card:hover { border-color: var(--line-strong); }
a.dt__card:hover .dt__name { color: var(--accent); }
.dt__card--m { border-left: 3px solid var(--m); }
.dt__card--f { border-left: 3px solid var(--f); }
.dt__card--self { background: var(--accent-soft); border-color: var(--accent); }
.dt__name { font-weight: 600; font-size: .93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dt__card { min-width: 0; flex: 0 1 auto; }
.dt__extra { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.dt__years { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.dt__sp { display: inline; font-size: .86rem; color: var(--muted); }
.dt__sp .i-rings { vertical-align: -1px; margin-right: 4px; }
.dt__sp .i-rings, .dt__grp .i-rings { width: 16px; height: 11px; color: var(--accent); flex: none; }
.dt__more { font: 600 .74rem/1.6 var(--sans); color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 0 8px; white-space: nowrap; }
.dt__more--link { text-decoration: none; color: var(--accent); }
.dt__grp { font-size: .86rem; color: var(--muted); display: flex; align-items: center; gap: 5px; min-height: 30px; }
.dt__living { display: inline-block; font-size: .86rem; font-style: italic; color: var(--muted); padding: 7px 0 7px 26px; }

/* ------------------------------------------------------------ timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 118px; top: 8px; bottom: 8px; border-left: 2px solid var(--line); }
.ev { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 30px; padding: 7px 0; position: relative; }
.ev::before { content: ""; position: absolute; left: 113px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.ev--birt::before, .ev--chr::before { border-color: var(--m); background: var(--m-soft); }
.ev--deat::before, .ev--buri::before { border-color: var(--ink-2); background: var(--ink-2); }
.ev--fam::before { border-color: var(--accent); background: var(--accent-soft); }
.ev--rel::before { width: 8px; height: 8px; left: 115px; top: 17px; border-width: 1px; }
.ev__date { font: 600 .9rem/1.5 var(--sans); color: var(--ink-2); text-align: right; padding-top: 3px; font-variant-numeric: tabular-nums; }
.ev__body { min-width: 0; padding-top: 2px; }
.ev__title { font-weight: 650; }
.ev__val { font-weight: 400; }
.ev--rel { color: var(--muted); font-size: .93rem; }
.ev--rel .ev__title { font-weight: 500; }
.ev--rel .ev__date { font-weight: 400; color: var(--muted); }
.ev--hist .ev__body { background: color-mix(in srgb, var(--gold) 14%, transparent); border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0; padding: 3px 10px; }
.ev--hist .ev__title { font: 600 .9rem/1.4 var(--sans); color: var(--gold); letter-spacing: .02em; }
.ev--hist .ev__date { font-weight: 400; color: var(--gold); }
.ev--hist::before { border-color: var(--gold); background: var(--surface); border-radius: 2px; transform: rotate(45deg); width: 10px; height: 10px; left: 114px; top: 16px; }
.ev__where, .ev__det { font-size: .93rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 2px 12px; }
.ev__cause { font-style: italic; }
.ev__txt p { margin: .2em 0; font-size: .93rem; color: var(--ink-2); }
.ev__cites { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.cite { display: inline-block; font-size: .8rem; line-height: 1.35; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2);
  text-decoration: none; max-width: 100%; overflow-wrap: anywhere; }
a.cite:hover { background: var(--accent-soft); color: var(--accent); }
.sources { margin: 0; padding-left: 1.2em; font-size: .95rem; }
.sources li { margin: 3px 0; }
.src__t { font-weight: 600; }


/* ------------------------------------------------------------ home */
.hero { text-align: center; padding: clamp(24px, 6vw, 64px) 0 32px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin: 0 0 10px; }
.hero__intro { color: var(--ink-2); font-size: 1.12rem; max-width: 40rem; margin: 0 auto 26px; }
.hero__intro p { margin: 0; }
.big-search { position: relative; max-width: 640px; margin: 0 auto; }
.big-search > svg { position: absolute; left: 18px; top: 17px; color: var(--muted); width: 22px; height: 22px; pointer-events: none; }
.big-search input { width: 100%; height: 56px; padding: 0 20px 0 52px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 1.08rem; box-shadow: var(--shadow); }
.big-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.big-search .live { text-align: left; }
.page-search .big-search { margin: 6px 0 14px; max-width: 760px; }
.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 34px; margin-top: 30px; }
.stat b { display: block; font: 650 1.9rem/1.1 var(--serif); color: var(--accent); }
.stat span { font-size: .9rem; color: var(--muted); }
.sec { margin-top: 36px; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.feature { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: start; gap: 14px; padding: 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.feature:hover { transform: translateY(-2px); border-color: var(--line-strong); color: var(--ink); }
.feature:hover b { color: var(--accent); }
.feature__img { aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.feature__img img { width: 100%; height: 100%; object-fit: cover; }
.feature__body { min-width: 0; display: flex; flex-direction: column; }
.feature__body b { font-family: var(--serif); font-size: 1.05rem; line-height: 1.2; }
.feature__body span { font-size: .85rem; }
.feature__body p { margin: 6px 0 0; font-size: .9rem; color: var(--ink-2); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 500; }
.chip span { font-size: .8rem; color: var(--muted); }
.chip:hover { border-color: var(--accent); color: var(--accent); }

/* ------------------------------------------------------------ lists */
.letters, .housenav { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 20px; padding: 8px 0; }
.letters { position: sticky; top: var(--header-h); background: var(--bg); z-index: 5; }
.house, .letter { scroll-margin-top: calc(var(--header-h) + 60px); }
.letters a, .housenav a { min-width: 34px; text-align: center; padding: 3px 7px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: .9rem; }
.housenav a { min-width: 40px; font-weight: 500; }
.housenav--grid a { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; padding: 4px 6px; min-width: 48px; }
.housenav--grid small { font-size: .7rem; font-weight: 400; color: var(--muted); }
.place-group { margin: 12px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; box-shadow: var(--shadow); }
.place-group > summary { cursor: pointer; font: 650 1.12rem/1.3 var(--serif); padding: 2px 0; }
.place-group .places { margin: 10px 0 4px; }
.place-group .h-grp { margin: 14px 0 4px; font-size: 1rem; }
.kpis--place { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.dectable { display: inline-block; max-width: 100%; vertical-align: top; }
.dectable table { width: auto; min-width: min(560px, 100%); }
.dectable td, .dectable th { text-align: right; font-variant-numeric: tabular-nums; }
.dectable th:first-child { text-align: left; }
.decnav { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 14px; font-size: .92rem; }
.decnav a:only-child[href]:not(:first-child) { margin-left: auto; }
.hrec.hrec--list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; }
.hrec__house { margin-left: 6px; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.letter h2 { font-size: 1.5rem; margin: 18px 0 8px; color: var(--accent); }
.rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.rows li { display: flex; flex-direction: column; gap: 3px; }
.pcard__sub { font-size: .82rem; color: var(--muted); line-height: 1.3; margin-top: 1px; }
.housenav-box { margin: 4px 0 16px; }
.housenav-box > summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 4px 0; }
.housenav-box .housenav { margin: 6px 0 0; }
.places { list-style: none; padding: 0; columns: 3 260px; column-gap: 28px; }
.places li { break-inside: avoid; padding: 4px 0; border-bottom: 1px solid var(--line); }
.place-kind { margin: 10px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.place-kind summary { cursor: pointer; font-weight: 650; font-family: var(--serif); font-size: 1.08rem; }
.place-kind .cards { margin-top: 10px; }
.house { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 10px; }
.house:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.house h3 { margin: 0 0 6px; font-size: 1.08rem; }
.hrec { list-style: none; margin: 0; padding: 0; font-size: .94rem; }
.hrec li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 2px 0; align-items: baseline; }
.hrec__date { font-weight: 500; font-size: .88rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hrec__lab { color: var(--muted); }
.search-filters { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 8px; font-size: .95rem; color: var(--ink-2); }
.search-filters input, .search-filters select { font: inherit; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); }
.search-filters input { width: 90px; }
.search-hint { font-size: .9rem; max-width: 760px; }
mark { background: color-mix(in srgb, var(--gold) 28%, transparent); color: inherit; border-radius: 2px; }

/* ------------------------------------------------------------ lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.lightbox::backdrop { background: rgba(10, 8, 6, .86); }
.lightbox img { display: block; max-width: 96vw; max-height: 88vh; border-radius: 6px; margin: 0 auto; }
.lightbox p { color: #eee; text-align: center; margin: 8px 0 0; font-size: .95rem; }
.lightbox button { position: fixed; top: 14px; right: 14px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 24px; cursor: pointer; }

/* ------------------------------------------------------------ footer */
.site-footer { border-top: 1px solid var(--line); padding: 22px 0 30px; font-size: .9rem; color: var(--ink-2); background: var(--surface); }
.site-footer p { margin: 4px 0; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1000px) {
  .topnav { display: none; }
  .menu-toggle { display: inline-grid; margin-right: -6px; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  main.wrap { padding-top: 14px; }
  .crumbs { margin-bottom: 10px; font-size: .85rem; }
  /* medallion: small photo next to the name, details below */
  .medallion { grid-template-columns: 84px minmax(0, 1fr); column-gap: 14px; row-gap: 0; padding: 14px; }
  .medallion--nophoto { grid-template-columns: 64px minmax(0, 1fr); }
  .medallion__body { display: contents; }
  .medallion__photo { grid-row: 1 / span 3; width: 100%; border-radius: 8px; }
  .medallion__photo--empty .mono { font-size: 1.3rem; }
  .medallion__top, .medallion h1, .medallion__names { grid-column: 2; }
  .medallion h1 { font-size: 1.55rem; margin-bottom: 2px; }
  .medallion__names { font-size: .92rem; margin-bottom: 0; gap: 2px 10px; }
  .eyebrow { font-size: .7rem; margin-bottom: 2px; }
  .medallion .med-grid, .medallion .private-note { grid-column: 1 / -1; margin-top: 14px; }
  .med-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .med-grid .tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .tile { padding: 8px 10px 9px; }
  .med-facts { padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--line); gap: 5px; }
  .mf { grid-template-columns: 88px minmax(0, 1fr); font-size: .92rem; }
  .tile__val { font-size: 1.05rem; }
  /* tabs scroll sideways – fade the edge to hint at more */
  .js .tabs__nav { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .tabs__nav a { padding: 10px 11px; }
  /* compact cards & lists */
  .pcard { padding: 8px 10px; gap: 10px; }
  .pcard .face { width: 38px; height: 38px; font-size: .78rem; }
  .rows { gap: 6px; }
  .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 8px; text-align: center; }
  .stat b { font-size: 1.5rem; }
  .features { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .feature { grid-template-columns: 76px minmax(0, 1fr); padding: 10px; gap: 12px; }
  .hero { padding: 18px 0 20px; }
  .hero h1 { font-size: 2rem; }
  .hero__intro { font-size: 1rem; margin-bottom: 18px; }
  .big-search input { height: 50px; font-size: 1rem; }
  .big-search > svg { top: 14px; }
  .page-title { font-size: 1.6rem; }
  .place-kind { padding: 8px 12px; }
  .house { padding: 10px 12px; }
  .hrec li { grid-template-columns: 78px minmax(0, 1fr); gap: 8px; font-size: .9rem; }
  .hrec__date { font-size: .8rem; }
  .desc-wrap { padding: 10px; }
  .dt__kids { padding-left: 10px; }
  .dt__kids > li { padding-left: 15px; }
  .dt__kids > li::after { width: 12px; }
  .dt__node > .dt__kids { margin-left: 14px; }
  div.dt__row { padding-left: 0; }
  .dt__name { font-size: .88rem; }
  .dt__row { flex-wrap: nowrap; gap: 4px 8px; }
  details > summary.dt__row, div.dt__row { flex-wrap: wrap; }
  .dt__tog { flex: none; }
  summary.dt__row > .dt__card { max-width: calc(100% - 28px); }
  .dt__extra { flex-basis: 100%; padding-left: 26px; font-size: .84rem; }
  div.dt__row > .dt__extra { padding-left: 4px; }
  .dt__years { font-size: .76rem; }
  .wrap, .site-header__inner { padding-left: 16px; padding-right: 16px; }
  .header-search { display: none; }
  .search-link { display: inline-grid; margin-left: auto; }
  .page-home .search-link, .page-search .search-link { display: none; }
  .brand__sub { display: none; }
  .prose { padding: 16px; }
  .timeline::before { left: 7px; }
  .ev { grid-template-columns: 1fr; gap: 0; padding-left: 26px; }
  .ev::before { left: 2px; top: 11px; }
  .ev--rel::before { left: 4px; top: 13px; }
  .ev--hist::before { left: 3px; top: 12px; }
  .ev__date { text-align: left; padding: 0; }
  .pbox { width: 150px; }
  .rows { grid-template-columns: 1fr; }
}
@media print {
  .site-header, .site-footer, .tabs__nav { display: none; }
  .js .panel[hidden] { display: block; }
  .js .panel__title { position: static !important; width: auto; height: auto; clip: auto; }
}

/* ------------------------------------------------------------ contact box */
.contact { display: flex; align-items: center; gap: 16px 24px; margin: 26px 0 8px; padding: 16px 20px; border-radius: 14px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.contact__text { flex: 1; min-width: 0; }
.contact h2 { font-size: 1.1rem; margin: 0 0 3px; }
.contact p { margin: 0; color: var(--ink-2); font-size: .95rem; }
.contact__btn { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.contact__btn:hover { background: var(--accent-hover); color: var(--accent-ink); text-decoration: none; }
@media (max-width: 720px) { .contact { flex-direction: column; align-items: stretch; padding: 14px; } .contact__btn { justify-content: center; } }

/* ------------------------------------------------------------ about page */
.prose--page { max-width: 52rem; font-size: 1.04rem; line-height: 1.65; padding: 26px 32px; }
.prose--page h2 { font-size: 1.3rem; margin-top: 1.6em; }
.prose--page ul { padding-left: 1.2em; }
.prose--page li { margin: .3em 0; }
@media (max-width: 1180px) { .header-search { width: min(260px, 26vw); } .topnav a { padding: 6px 8px; } }
@media (max-width: 1320px) { .site-header .brand__sub { display: none; } }
@media (max-width: 720px) { .prose--page { padding: 16px; font-size: 1rem; } }

/* ------------------------------------------------------------ statistics & charts */
/* chart palette validated for CVD separation (light: ΔE 10.6, dark: ΔE 11.5) */
:root { --c-m: #3267a8; --c-f: #c8506a; --c-acc: var(--accent); --c-acc2: color-mix(in srgb, var(--accent) 38%, var(--surface)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-m: #4f8fd8; --c-f: #dc6a8c; } }
:root[data-theme="dark"] { --c-m: #4f8fd8; --c-f: #dc6a8c; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 26px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.kpi b { display: block; font: 650 1.6rem/1.15 var(--serif); color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi span { font-size: .85rem; color: var(--muted); line-height: 1.3; display: block; margin-top: 2px; }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.charts__row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.charts__note { grid-column: 1 / -1; margin: -6px 0 0; font-size: .88rem; color: var(--muted); }
.charts__note--lead { margin: 10px 0 -4px; font-size: .95rem; color: var(--ink-2); }
.charts__note--lead b { font-family: var(--serif); font-size: 1.1rem; color: var(--ink); margin-right: 2px; }
/* heat table: cause × decade, background = share */
.heat table { width: auto; min-width: 100%; }
.heat th, .heat td { white-space: nowrap; }
.heat thead th:not(:first-child) { text-align: center; font-variant-numeric: tabular-nums; }
.heat tbody th { font-weight: 500; text-align: left; background: none; }
.heat__c { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; font-size: .82rem; color: var(--ink-2);
  background: color-mix(in srgb, var(--c-acc) var(--a), transparent); }
.heat__hi { color: #fff; font-weight: 600; }
.chart { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 12px; box-shadow: var(--shadow); min-width: 0; }
.chart--wide { grid-column: 1 / -1; }
.chart figcaption h3 { font-size: 1.05rem; margin: 0 0 2px; }
.chart figcaption p { margin: 0 0 10px; font-size: .85rem; color: var(--muted); line-height: 1.35; }
.chart figcaption .chart__legend { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-2); font-size: .85rem; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw--m, .vb__bar--m, .hb__bar--m { background: var(--c-m); }
.sw--f, .vb__bar--f, .hb__bar--f { background: var(--c-f); }
.sw--acc, .vb__bar--acc, .hb__bar--acc { background: var(--c-acc); }
.sw--acc2, .vb__bar--acc2 { background: var(--c-acc2); }
.chart__table { margin-top: 8px; font-size: .85rem; }
.chart__table summary { cursor: pointer; color: var(--muted); }
.chart__table .table-wrap { max-height: 260px; overflow: auto; }

/* vertical bars */
.vb { padding-left: 34px; }
.vb__plot { position: relative; height: var(--h, 200px); }
.vb__grid span { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.vb__grid span:first-child { border-top-color: var(--line-strong); }
.vb__grid i { position: absolute; right: calc(100% + 6px); top: -.6em; font: normal .72rem/1.2 var(--sans); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.vb__cols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; }
.vb__col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 1px; outline: none; border-radius: 4px 4px 0 0; }
.vb__col:hover, .vb__col:focus-visible { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.vb__bar { flex: 1 1 0; max-width: 34px; border-radius: 4px 4px 0 0; }
.vb__col--stack { flex-direction: column-reverse; align-items: center; justify-content: flex-start; gap: 0; }
.vb__seg { width: 100%; max-width: 34px; flex: none; }
.vb__seg:last-child { border-radius: 4px 4px 0 0; }
.vb__seg + .vb__seg { box-shadow: 0 2px 0 var(--surface); }
.vb__x { display: flex; gap: 2px; margin-top: 4px; }
.vb__x span { flex: 1 1 0; min-width: 0; text-align: center; font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: visible; font-variant-numeric: tabular-nums; }

/* horizontal bars */
.hb { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.hb li { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) 42px; gap: 8px; align-items: center; padding: 2px 4px; border-radius: 6px; outline: none; }
.hb li:hover, .hb li:focus-visible { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.hb__lab { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.charts__row .hb__lab { white-space: normal; line-height: 1.2; }   /* narrow 3-up charts: wrap instead of cutting */
.hb__track { height: 12px; }
.hb__bar { display: block; height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.hb__val { font-size: .82rem; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }

/* tooltip */
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: var(--bg); font-size: .82rem; line-height: 1.35;
  padding: 6px 9px; border-radius: 6px; box-shadow: var(--shadow-lg); max-width: 260px; }
.tip[hidden] { display: none; }

/* records */
.stats__h { margin-top: 34px; }
.records { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.rec { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.rec h3 { font-size: 1rem; margin: 0 0 8px; }
.rec ol { margin: 0; padding-left: 1.3em; font-size: .93rem; }
.rec li { margin: 3px 0; }
.rec li span { color: var(--muted); font-size: .85rem; margin-left: 4px; white-space: nowrap; }

@media (max-width: 720px) {
  .charts { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi b { font-size: 1.35rem; }
  .chart { padding: 12px; }
  .vb { padding-left: 28px; }
}

/* ------------------------------------------------------------ "experimental" badge */
.status-badge { flex: none; display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; padding: 3px 10px 3px 8px;
  border-radius: 999px; border: 1px dashed var(--accent); background: var(--accent-soft); color: var(--accent);
  font: 650 .72rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .07em; text-decoration: none; white-space: nowrap; }
.status-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  animation: status-pulse 2.4s ease-in-out infinite; }
a.status-badge:hover { text-decoration: none; background: var(--surface); color: var(--accent); }
@keyframes status-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .status-badge::before { animation: none; } }
.status-note { max-width: 40rem; margin: -10px auto 22px; font-size: .95rem; color: var(--ink-2); }
.status-badge--static { margin: 0 6px 0 0; vertical-align: 1px; }
@media (min-width: 1001px) { .site-header .brand { flex: none; } }   /* desktop: the badge must not squeeze the title */
.site-header .brand__text { overflow: hidden; }
.site-header .brand__title { overflow: hidden; text-overflow: ellipsis; }   /* never run under the buttons */
.status-strip { display: none; }
@media (max-width: 1000px) {
  .site-header .status-badge { display: none; }
  .status-strip { display: block; padding: 5px 16px; background: var(--accent-soft); border-bottom: 1px dashed var(--accent);
    color: var(--accent); font: 600 .74rem/1.4 var(--sans); text-align: center; text-decoration: none; letter-spacing: .02em; }
  .status-strip b { text-transform: uppercase; letter-spacing: .07em; }
  .status-strip:hover { text-decoration: none; color: var(--accent-hover); }
}
@media (max-width: 480px) { .site-header .brand__title { font-size: 1.02rem; } .site-header .brand img { height: 32px; } }
@media (max-width: 1400px) { .header-search { width: min(240px, 22vw); } }
@media (max-width: 1180px) { .site-header .status-badge { font-size: 0; gap: 0; padding: 5px; } }

/* ------------------------------------------------------------ link to the history site */
.xlink { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 14px; max-width: 560px;
  margin: 4px 0 20px; padding: 11px 16px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; }
.xlink:hover { text-decoration: none; color: var(--ink); background: var(--surface); }
.xlink__site { grid-column: 1; font: 600 .74rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.xlink__title { grid-column: 1; font: 650 1.05rem/1.3 var(--serif); }
.xlink__arrow { grid-column: 2; grid-row: 1 / span 2; font-size: 1.3rem; color: var(--accent); }
.medallion .xlink { margin: 14px 0 0; }
@media (max-width: 720px) { .medallion .xlink { grid-column: 1 / -1; } }

/* ------------------------------------------------------------ kinship finder */
.med-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 10px; margin-top: 14px; }
.med-kin, .kin-follow__btn { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border: 1px solid var(--line-strong);
  border-radius: 999px; font: inherit; font-size: .9rem; color: var(--ink-2); text-decoration: none; background: var(--surface); cursor: pointer; }
.med-kin:hover, .kin-follow__btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.kin-follow__btn::before { content: "☆"; font-size: 1rem; line-height: 1; }
/* followed person: the relation of this page's person to them */
.kin-follow:has(.kin-follow__card) { flex-basis: 100%; }
.kin-follow__card { margin: 0; max-width: 560px; padding: 9px 14px; border: 1px dashed var(--accent); border-radius: var(--radius);
  background: var(--accent-soft); font-size: .95rem; color: var(--ink-2); }
.kin-follow__card b { color: var(--ink); font-family: var(--serif); font-size: 1.05rem; }
.kin-follow__eyebrow { display: block; font: 600 .72rem/1.4 var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.kin-follow__more { color: var(--muted); }
.kin-follow__card { position: relative; padding-right: 42px; }
.kin-follow__x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--accent); font: 400 1.35rem/1 var(--sans); cursor: pointer; }
.kin-follow__x:hover, .kin-follow__x:focus-visible { background: var(--surface); color: var(--accent-hover); }
.med-kin svg { flex: none; }
.kin__picks { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 12px; margin: 6px 0 22px; }
.kin__pick { min-width: 0; }
.kin__lab { display: block; font: 600 .78rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.kin__search { max-width: none; margin: 0; }
.kin__pick.is-set .kin__search { display: none; }
.kin__sel { position: relative; }
.kin__sel .pcard { padding-right: 44px; min-height: 56px; }
.kin__clear { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--ink-2); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.kin__clear:hover { background: var(--accent-soft); color: var(--accent); }
.kin__swap { margin-bottom: 8px; font-size: 1.2rem; }
.kin__result:empty { display: none; }
.kin__head { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 18px; }
.kin__head h2 { margin: 0 0 6px; }
.kin__head p { margin: 8px 0 0; color: var(--ink-2); }
.kin__head p.kin__pair { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-top: 4px; font: 1.3rem/1.35 var(--serif); color: var(--ink); }
.kin__pair b { font-weight: 650; }
.kin__tree { display: flex; flex-direction: column; align-items: center; margin-bottom: 10px; }
.kin__top { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; }
.kin__top .pcard, .kin__col .pcard, .kin__chain .pcard { width: min(320px, 100%); }
.kin__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; width: min(700px, 100%); position: relative; padding-top: 22px; }
/* the inverted V: a bracket from the ancestors down to both lines */
.kin__cols::before { content: ""; position: absolute; top: 10px; left: calc(25% - 7px); right: calc(25% - 7px); height: 12px; border: 2px solid var(--line-strong); border-bottom: 0; border-radius: 8px 8px 0 0; }
.kin__cols::after { content: ""; position: absolute; top: 0; left: 50%; height: 10px; border-left: 2px solid var(--line-strong); }
.kin__col, .kin__chain { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.kin__arrow { color: var(--muted); line-height: 1; padding: 4px 0; }
.kin__more { padding-left: 1.2em; }
.kin__more li { margin: 4px 0; }
.kin__none { color: var(--muted); }
.kin__hint { margin-top: 26px; font-size: .9rem; }
@media (max-width: 720px) {
  .medallion .med-actions { grid-column: 1 / -1; }
  .kin__picks { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .kin__swap { justify-self: center; margin: 0; transform: rotate(90deg); }
  .kin__head p.kin__pair { font-size: 1.12rem; }
  .kin__cols { gap: 0 10px; }
  .kin__col .pcard { padding: 7px 8px; }
  .kin__col .face { display: none; }
}
