/* =========================================================================
   Roots4Family – styles ("A · Editorial")
   Layout: fixed top bar, left sidebar, scrolling view. Dark by default,
   light theme via [data-theme="light"]. Print styles at the end.
   Fonts are self-hosted (vendor/fonts) – no requests to third parties.
   ========================================================================= */

@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("../vendor/fonts/manrope-latin-ext.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: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("../vendor/fonts/manrope-latin.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: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/ibmplexmono-400-latin-ext.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: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/ibmplexmono-400-latin.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: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/ibmplexmono-500-latin-ext.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: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/ibmplexmono-500-latin.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; }

/* ------------------------------------------------------------------------ */
/* Tokens                                                                    */
/* ------------------------------------------------------------------------ */

:root {
  --bg: #0b0f13;
  --bg-2: #0e141b;                 /* panel2 */
  --panel: #111820;                /* card */
  --panel-solid: #111820;
  --panel-border: rgba(255, 255, 255, 0.09);   /* line */
  --line-strong: rgba(255, 255, 255, 0.17);
  --text: #e9eef3;                 /* ink */
  --muted: #9aa7b2;                /* ink2 */
  --ink3: #6b7783;
  --accent: #70d3bb;
  --accent-ink: #8ee5cf;
  --accent-soft: rgba(112, 211, 187, 0.13);
  --on-accent: #06211c;
  --accent-2: #eec066;             /* amber */
  --amber-soft: rgba(238, 192, 102, 0.07);
  --amber-line: rgba(238, 192, 102, 0.25);
  --good: #6fcf9a;
  --warn: #eec066;
  --bad: #f07a7a;
  --info: #72b8f2;
  --male: #72b8f2;                 /* blue */
  --female: #f589b6;               /* pink */
  --unknown: #aab4bd;
  --chip: rgba(255, 255, 255, 0.055);
  --glow: rgba(112, 211, 187, 0.13);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --topbar-h: 62px;
  --topbar-pad: 22px;
  --sidebar-w: 218px;
  /* Inhaltsraster der Eingangsseite (Header ohne Daten richtet sich daran aus) */
  --l-max: 1200px;
  --l-pad: 32px;
  --hover: rgba(255, 255, 255, 0.05);
  --grid-line: rgba(255, 255, 255, 0.07);
  /* Farbpalette für Eingangsseite und Navigation */
  --c-teal: #70d3bb;
  --c-blue: #72b8f2;
  --c-amber: #eec066;
  --c-violet: #b39cf5;
  --c-coral: #f0907a;
  --c-pink: #f589b6;
  --c-gold: #d9a441;
  --c-ink: #0b1218;                /* dunkle Schrift auf Vollfarbe */
  /* Seitenleiste: Vollfarbe, gerade Kanten */
  --nav-bg: linear-gradient(180deg, #0f1f2c 0%, #0b1620 55%, #0a1118 100%);
  --nav-text: #c9d4dd;
  --nav-muted: #7f8e9b;
  --nav-hover: rgba(255, 255, 255, 0.06);
  --nav-line: rgba(255, 255, 255, 0.09);
  --font: "Manrope", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  font-family: var(--font);
  font-size: 14px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #fbfaf8;
  --bg-2: #f4f2ef;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --panel-border: rgba(15, 25, 35, 0.10);
  --line-strong: rgba(15, 25, 35, 0.20);
  --text: #15202a;
  --muted: #4d5966;
  --ink3: #5d646a;
  --accent: #50c1a8;
  --accent-ink: #006e5c;
  --accent-soft: rgba(80, 193, 168, 0.13);
  --on-accent: #04201b;
  --accent-2: #8c5500;
  --amber-soft: rgba(208, 144, 51, 0.11);
  --amber-line: rgba(175, 113, 0, 0.32);
  --good: #1f8a5b;
  --warn: #8c5500;
  --bad: #c2453f;
  --info: #0062a1;
  --male: #0062a1;
  --female: #a43068;
  --unknown: #7a8590;
  --chip: rgba(15, 25, 35, 0.05);
  --glow: rgba(80, 193, 168, 0.16);
  --hover: rgba(15, 25, 35, 0.04);
  --grid-line: rgba(15, 25, 35, 0.08);
  --shadow: 0 16px 40px rgba(20, 30, 60, 0.12);
  --c-teal: #1f9e85;
  --c-blue: #2b7cc4;
  --c-amber: #b8790a;
  --c-violet: #7c5cd6;
  --c-coral: #d6553d;
  --c-pink: #c2407d;
  --c-gold: #9a6b0f;
  --c-ink: #ffffff;
  /* Die Seitenleiste bleibt auch im hellen Thema eine Vollfarbfläche. */
  --nav-bg: linear-gradient(180deg, #123d47 0%, #0f333c 60%, #0d2a31 100%);
  --nav-text: #d5e6e8;
  --nav-muted: #8fb0b4;
  --nav-hover: rgba(255, 255, 255, 0.08);
  --nav-line: rgba(255, 255, 255, 0.12);
  color-scheme: light;
}
/* Gruppenfarben der Navigation bleiben im hellen Thema die kräftigen Töne auf dunklem Grund. */
[data-theme="light"] .sidebar { --c-teal: #70d3bb; --c-blue: #72b8f2; --c-amber: #eec066; --c-violet: #b39cf5; --c-ink: #0b1218; }

/* ------------------------------------------------------------------------ */
/* Base                                                                      */
/* ------------------------------------------------------------------------ */

* { box-sizing: border-box; }
/* Straight edges everywhere: no rounded corners on any element, including
   native form controls (Chromium rounds inputs/selects/buttons by default). */
*, ::before, ::after { border-radius: 0; }
button, input, select, textarea, progress, meter { border-radius: 0; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; height: 100vh; }
button, input, select, textarea, label { font: inherit; color: inherit; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
p { margin: 0 0 10px; line-height: 1.5; text-wrap: pretty; }
::selection { background: rgba(112, 211, 187, 0.25); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono, .eyebrow, .nav-title, .stat-label, .section-head h2, .record-label, .card-label, .tl-year, .year-range, .map-attr, .table-foot, .file-label, .kbd { font-family: var(--mono); }
.eyebrow { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 6px 10px; }
.skip:focus { left: 8px; }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { transition: none !important; animation: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------------ */
/* Top bar                                                                   */
/* ------------------------------------------------------------------------ */

.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 30;
  display: flex; align-items: center; gap: 16px; padding: 0 var(--topbar-pad);
  background: var(--bg-2); border-bottom: 1px solid var(--panel-border);
}
/* Ohne geladene Datei folgt der Header dem Inhaltsraster der Eingangsseite und ist etwas größer. */
body:not(.has-data) .topbar { padding: 0 max(var(--topbar-pad), calc((100% - var(--l-max)) / 2)); }
body:not(.has-data) .topbar .btn.primary { padding: 10px 18px; font-size: 14px; border-radius: 10px; }
body:not(.has-data) .language-toggle { padding: 9px 26px 9px 10px; font-size: 13px; border-radius: 10px; }
body:not(.has-data) .language-control { font-size: 12px; }
body:not(.has-data) .language-menu { border-radius: 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; min-width: 0; }
.brand .brand-name { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }
.brand .brand-name em { font-style: normal; color: var(--accent-ink); }
.logo { width: 32px; height: 32px; flex: none; display: block; }
.topbar .divider { width: 1px; height: 16px; background: var(--line-strong); }
body:not(.has-data) .topbar .divider { display: none; }
.file-label { color: var(--ink3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.topbar .nav-toggle { display: none; }
.actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.language-control { position: relative; display: flex; align-items: center; gap: 7px; flex: none; font-size: 11px; color: var(--muted); }
.language-control select.language-native {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); border: 0; appearance: none;
}
.language-toggle {
  position: relative; display: inline-flex; align-items: center; gap: 7px; min-width: 103px; max-width: 220px;
  padding: 7px 25px 7px 9px;
  border: 1px solid var(--panel-border); background: var(--panel); color: var(--text);
  font: inherit; font-size: 12px; line-height: 1.2; cursor: pointer; text-align: left;
}
.language-toggle::after {
  content: ""; position: absolute; right: 10px; width: 0; height: 0;
  border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 4px solid var(--muted);
}
.language-current { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.language-toggle:disabled { opacity: 0.6; cursor: wait; }
.language-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.language-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40;
  min-width: 100%; max-height: min(70vh, 420px); overflow: auto;
  margin: 0; padding: 4px; list-style: none;
  background: var(--panel-solid); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
}
.language-option {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px;
  border: 0; background: transparent; color: var(--text); font: inherit; font-size: 12px;
  text-align: left; cursor: pointer; white-space: nowrap;
}
.language-option:hover, .language-option:focus-visible { background: var(--hover); outline: none; }
.language-option[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-ink); }
@media (max-width: 1100px) { .language-caption { display: none; } .file-label { max-width: 160px; } }
@media (max-width: 620px) { .language-toggle { min-width: 0; max-width: 132px; padding-left: 6px; } .topbar .actions { gap: 5px; } }
body:not(.has-data) .filter-btn { display: none; }

.search { position: relative; flex: 1 1 320px; max-width: 480px; }
.topbar .search input {
  width: 100%; padding: 9px 40px 9px 36px; border: 1px solid var(--panel-border);
  background: var(--panel); color: var(--text); outline: none; font-size: 13px;
}
.search input[type="search"] { -webkit-appearance: none; appearance: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search::before { content: ""; position: absolute; left: 13px; top: 19px; width: 14px; height: 14px; z-index: 1; pointer-events: none; opacity: 0.6;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%239aa7b2' stroke-width='1.5'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cline x1='10.5' y1='10.5' x2='14' y2='14'/%3E%3C/svg%3E"); }
.search::after { content: "/"; position: absolute; right: 10px; top: 11px; z-index: 1; font-family: var(--mono); font-size: 10px; color: var(--ink3); border: 1px solid var(--panel-border); padding: 1px 5px; pointer-events: none; }
.search input::placeholder { color: var(--ink3); }
.search input:focus { border-color: var(--accent); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 60vh; overflow: auto;
  margin: 0; padding: 6px; list-style: none; background: var(--panel-solid); border: 1px solid var(--line-strong);
 box-shadow: var(--shadow); z-index: 40;
}
.search-results li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer; font-size: 13px; }
.search-results li.group { cursor: default; color: var(--ink3); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; padding-top: 10px; }
.search-results li small { color: var(--ink3); margin-left: auto; white-space: nowrap; font-family: var(--mono); font-size: 10.5px; }
.search-results li .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results li:hover:not(.group), .search-results li.active { background: var(--accent-soft); }
.search-results i.type { width: 18px; height: 18px; background: var(--chip); font-size: 10px; display: inline-flex; align-items: center; justify-content: center; font-style: normal; color: var(--muted); font-family: var(--mono); }

/* ------------------------------------------------------------------------ */
/* Buttons, inputs, pills                                                    */
/* ------------------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border: 1px solid var(--panel-border); background: transparent; color: var(--muted);
  cursor: pointer; font-size: 12.5px; font-weight: 600; line-height: 1.2; text-decoration: none !important; white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s, filter 0.15s;
}
.btn:hover { color: var(--text); border-color: var(--line-strong); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.08); color: var(--on-accent); }
.btn.soft, .btn.toggle[aria-pressed="true"], .btn.active { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 4px 9px; font-size: 11.5px; }
.btn.big { padding: 14px 24px; font-size: 14.5px; }
.btn.big:not(.primary) { border-color: var(--line-strong); color: var(--text); }
.btn.big:not(.primary):hover { border-color: var(--accent); color: var(--accent-ink); }
.btn .badge { background: var(--accent); color: var(--on-accent); padding: 0 7px; font-size: 11px; font-weight: 700; }
.seg { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--panel-border); }
.seg .btn { border: 0; padding: 6px 14px; }
.seg .btn.primary { background: var(--accent-soft); color: var(--accent-ink); }

.input, .select, input[type="text"], input[type="number"], input[type="search"], input[type="password"], input[type="url"], select, textarea {
  padding: 8px 11px; border: 1px solid var(--panel-border);
  background: var(--panel); color: var(--text); outline: none; min-width: 0; font-size: 13px;
}
select option { background: var(--panel-solid); color: var(--text); }
:is(.input, .select, input, select, textarea):focus { border-color: var(--accent); }
/* Square slider: native thumbs are round, so draw our own. */
input[type="range"] { -webkit-appearance: none; appearance: none; height: 22px; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--chip); }
input[type="range"]::-moz-range-track { height: 4px; background: var(--chip); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -5px; background: var(--accent); border: 0; }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; background: var(--accent); border: 0; }
input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Square checkbox: native boxes have rounded corners in every engine. */
input[type="checkbox"] { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin: 0 2px 0 0; flex: none; border: 1px solid var(--line-strong); background: var(--panel); display: inline-grid; place-items: center; cursor: pointer; vertical-align: -3px; accent-color: var(--accent); }
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after { content: ""; width: 5px; height: 9px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
input[type="checkbox"]:disabled { opacity: 0.5; cursor: default; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.year-input { width: 92px; }
textarea.coords-input { width: 100%; font-family: var(--mono); font-size: 12px; }

.pill { display: inline-flex; align-items: center; padding: 1px 8px; font-size: 11px; font-family: var(--mono); background: var(--chip); color: var(--muted); margin-left: 4px; white-space: nowrap; }
.pill.good, .pill.possibly-living { background: rgba(111, 207, 154, 0.16); color: var(--good); }
.pill.warn, .pill.unknown { background: var(--amber-soft); color: var(--warn); border: 1px solid var(--amber-line); }
.pill.bad { background: rgba(240, 122, 122, 0.16); color: var(--bad); }
.pill.info { background: rgba(114, 184, 242, 0.16); color: var(--info); }
.pill.deceased { background: var(--chip); color: var(--ink3); }
.pill.presumed-deceased { background: var(--chip); color: var(--muted); }
.flag { color: var(--warn); cursor: help; }
.tag { display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; padding: 1px 7px; background: var(--accent-soft); color: var(--accent-ink); margin-left: 6px; vertical-align: middle; }

.dot { display: inline-block; width: 8px; height: 8px; background: var(--unknown); flex: none; }
.dot.male, .dot.M { background: var(--male); }
.dot.female, .dot.F { background: var(--female); }
.dot.unknown, .dot.U { background: var(--unknown); }

/* ------------------------------------------------------------------------ */
/* App layout                                                                */
/* ------------------------------------------------------------------------ */

.app { position: fixed; inset: var(--topbar-h) 0 0 0; display: grid; grid-template-columns: var(--sidebar-w) 1fr; }
/* Seitenleiste: Vollfarbfläche, gerade Kanten, eine Farbe je Gruppe (--g). */
.sidebar { background: var(--nav-bg); overflow-y: auto; padding: 16px 0 60px; box-shadow: inset -1px 0 0 var(--nav-line); }
.nav-group { --g: var(--c-teal); display: flex; flex-direction: column; gap: 0; margin-bottom: 16px; }
.nav-group:nth-child(2) { --g: var(--c-blue); }
.nav-group:nth-child(3) { --g: var(--c-amber); }
.nav-group:nth-child(4) { --g: var(--nav-muted); }
.nav-group:last-child { padding-top: 14px; border-top: 1px solid var(--nav-line); margin-bottom: 0; }
.nav-title { display: flex; align-items: center; gap: 8px; color: var(--g); font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.16em; padding: 0 16px 8px 16px; }
.nav-title::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--g) 35%, transparent); }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 13px;
  border-left: 3px solid transparent; color: var(--nav-text); text-decoration: none !important; font-size: 13.5px; font-weight: 500;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.nav-item:hover { background: var(--nav-hover); color: #fff; border-left-color: var(--g); }
.nav-item.active { background: var(--g); border-left-color: var(--g); color: var(--c-ink); font-weight: 700; }
.nav-item.active:hover { color: var(--c-ink); }
.nav-icon {
  display: grid; place-items: center; width: 22px; height: 22px; flex: none; font-size: 12px; line-height: 1;
  color: var(--g); background: color-mix(in srgb, var(--g) 16%, transparent);
}
.nav-item.active .nav-icon { color: var(--c-ink); background: rgba(0, 0, 0, 0.16); }
.nav-group:nth-child(4) .nav-item.active { color: #0b1218; }
.view { overflow-y: auto; overflow-x: hidden; padding: 34px 34px 90px; scroll-behavior: smooth; }
.view:focus { outline: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head .eyebrow { margin-bottom: 10px; }
.page-head h1 { font-size: 38px; line-height: 1.05; font-weight: 800; letter-spacing: -0.035em; }
.page-head .sub { color: var(--muted); margin: 10px 0 0; max-width: 62ch; font-size: 14px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section { margin: 0 0 42px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; color: var(--muted); white-space: nowrap; }
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--panel-border); order: 1; }
.section-head > :not(h2) { order: 2; }
.section .intro { color: var(--muted); margin: -4px 0 14px; font-size: 13.5px; max-width: 80ch; }

.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.stats { margin: 0 0 12px; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 1px; background: var(--panel-border); border: 1px solid var(--panel-border); overflow: hidden; }
.grid.stats.compact { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 9px; background: none; border: 0; overflow: visible; }
.grid.highlights, .grid.nav-cards, .grid.records, .grid.insights { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); align-items: start; }
.grid.profile { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  position: relative; background: var(--panel); border: 1px solid var(--panel-border);
  padding: 20px 22px; color: var(--text); text-decoration: none !important; min-width: 0;
}
a.card:hover { border-color: var(--accent); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-sub { color: var(--muted); font-size: 12.5px; margin: -8px 0 14px; }
.card-foot { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--panel-border); color: var(--ink3); font-family: var(--mono); font-size: 10.5px; }
.card.active { border-color: var(--accent); }
.card.accent-bar { overflow: hidden; }
.card.accent-bar::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--accent); }
.card.soft { background: var(--bg-2); }
.nav-card { padding: 16px 17px; background: var(--bg-2); }
.nav-card:hover { background: var(--panel); }
.nav-card .nav-icon { display: none; }
.nav-card h3 { font-size: 14px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.nav-card h3::after { content: "→"; margin-left: auto; color: var(--ink3); font-weight: 400; }
.nav-card p { font-size: 12.5px; color: var(--muted); margin: 0; }
.hl-value { font-size: 30px; font-weight: 800; letter-spacing: -0.035em; line-height: 1; margin: 6px 0 10px; color: var(--text); font-variant-numeric: tabular-nums; }
.hl-value.long, .record .record-value.long { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.highlight.hero { grid-column: span 2; padding: 26px; }
.highlight.hero .hl-value { font-size: 50px; letter-spacing: -0.04em; margin: 4px 0 14px; }
.highlight p.muted { font-size: 12.5px; margin: 8px 0 0; }
.section-link { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.section-count { font-family: var(--mono); font-size: 10.5px; color: var(--ink3); }
.record-group .section-head h2 { font-family: var(--font); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; text-transform: none; color: var(--text); }
.record-group .section-head .section-count { order: 0; }
@media (max-width: 620px) { .highlight.hero { grid-column: auto; } }
.record .record-value { font-size: 30px; font-weight: 800; letter-spacing: -0.035em; line-height: 1; color: var(--text); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.record .card-head h3, .highlight .card-head h3, .insight .card-head h3 { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; color: var(--ink3); }
.insight-icon { display: none; }
.insight { display: flex; flex-direction: column; gap: 11px; }
.insight .card-head { margin-bottom: 0; }
.insight .card-head .tag { margin-left: 0; padding: 3px 9px; }
.insight .insight-title { font-size: 15.5px; font-weight: 700; line-height: 1.3; letter-spacing: -0.015em; text-wrap: pretty; }
.insight p { font-size: 13px; color: var(--muted); margin: 0; }
.insight .card-foot { margin-top: auto; }

.stat { background: var(--panel); padding: 21px 20px; color: var(--text); text-decoration: none !important; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.grid.stats.compact .stat { border: 1px solid var(--panel-border); background: var(--bg-2); padding: 14px 15px; gap: 2px; }
a.stat:hover { background: var(--bg-2); }
.stat-value { font-size: 42px; font-weight: 800; letter-spacing: -0.035em; line-height: 1; word-break: break-word; font-variant-numeric: tabular-nums; order: 2; }
.grid.stats.compact .stat-value { font-size: 24px; letter-spacing: -0.03em; }
.stat-label { color: var(--ink3); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; order: 1; }
.grid.stats.compact .stat-label { font-family: var(--font); font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--muted); order: 3; }
.stat-sub { color: var(--muted); font-size: 12.5px; order: 3; }
.grid.stats.compact .stat-sub { font-family: var(--mono); font-size: 10px; color: var(--ink3); order: 4; }
.stat-icon { display: none; }
.stat.good .stat-value { color: var(--good); }
.stat.warn .stat-value { color: var(--warn); }
.stat.bad .stat-value { color: var(--bad); }

.kv { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 0 14px; margin: 0; }
.kv dt { color: var(--ink3); font-size: 12.5px; padding: 8px 0; border-top: 1px solid var(--panel-border); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: 12.5px; font-weight: 600; text-align: right; padding: 8px 0; border-top: 1px solid var(--panel-border); }
.kv dt:first-of-type, .kv dd:first-of-type { border-top: 0; }

.empty { text-align: center; padding: 30px 18px; color: var(--muted); border: 1px dashed var(--line-strong); }
.empty-icon { font-size: 26px; opacity: 0.6; margin-bottom: 8px; color: var(--accent); }
.empty-msg { color: var(--text); font-weight: 600; }
.empty-hint { font-size: 13px; margin: 6px auto 0; max-width: 60ch; }

.notice { position: relative; padding: 13px 16px 13px 30px; border: 1px solid var(--panel-border); background: var(--panel); margin: 0 0 12px; line-height: 1.5; font-size: 13px; color: var(--muted); }
.notice::before { content: ""; position: absolute; left: 14px; top: 19px; width: 6px; height: 6px; background: var(--info); }
.notice.warn { border-color: var(--amber-line); background: var(--amber-soft); }
.notice.warn::before { background: var(--accent-2); }
.notice.good { border-color: rgba(111, 207, 154, 0.35); }
.notice.good::before { background: var(--good); }
.notice.bad { border-color: rgba(240, 122, 122, 0.45); background: rgba(240, 122, 122, 0.07); }
.notice.bad::before { background: var(--bad); }
.notice.float { position: absolute; top: 10px; left: 10px; right: auto; z-index: 3; box-shadow: var(--shadow); }
.provenance { color: var(--ink3); font-family: var(--mono); font-size: 10.5px; border-top: 1px solid var(--panel-border); padding: 11px 0 0; margin: 14px 0 0; line-height: 1.5; }
.hint-line { font-size: 12.5px; color: var(--ink3); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 22px; }
.tab { background: transparent; border: 1px solid var(--panel-border); padding: 6px 14px; color: var(--muted); cursor: pointer; font-size: 12.5px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--text); border-color: var(--line-strong); }
.tab[aria-selected="true"] { color: var(--on-accent); background: var(--accent); border-color: var(--accent); font-weight: 700; }
.tab .count { font-family: var(--mono); font-size: 10.5px; opacity: 0.8; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 0 0 16px; }
.toolbar .picker { min-width: 240px; flex: 1 1 240px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; font-size: 12.5px; font-weight: 600;
  background: var(--chip); border: 1px solid transparent; color: var(--text); text-decoration: none !important; cursor: pointer; max-width: 100%;
}
.chip:hover { border-color: var(--accent); text-decoration: none; }
.chip small, .chip .muted { color: var(--ink3); font-family: var(--mono); font-size: 10.5px; font-weight: 400; white-space: nowrap; }
.chip.fam { color: var(--accent-2); }
.chip.lock, .chip.protected { opacity: 0.75; }
.plink { color: var(--text); border-bottom: 1px dotted var(--ink3); }
.plink:hover { color: var(--accent-ink); text-decoration: none; }
ul.plain, ol.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li, ol.plain li { padding: 5px 0; line-height: 1.5; }
ul.plain.compact li { padding: 1px 0; }
.rel-group { margin-bottom: 14px; }
.rel-group h4, .sub-group h5 { color: var(--ink3); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 8px; font-weight: 500; }
.sub-group { margin-top: 8px; }

div.bar { position: relative; height: 6px; min-height: 6px; background: var(--chip); overflow: hidden; flex: 1; min-width: 60px; }
.rank-row div.bar { flex: none; width: 100%; }
.bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.bar-row .bar-label { flex: 0 0 46%; color: var(--muted); }
.bar-row .bar { flex: 1; }
.bar-row .bar + span, .bar-label + .bar + span { min-width: 60px; text-align: right; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-row { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; }
.rank-head { display: flex; align-items: baseline; gap: 10px; }
.rank-label { font-size: 13.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-value { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.rank-row:hover .rank-label { color: var(--accent-ink); }

/* ------------------------------------------------------------------------ */
/* Tables                                                                    */
/* ------------------------------------------------------------------------ */

.table-wrap { overflow-x: auto; border: 1px solid var(--panel-border); background: var(--panel); }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th, table.table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--grid-line); vertical-align: top; }
table.table th { color: var(--ink3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; white-space: nowrap; cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--panel-solid); }
table.table th.num, table.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.table th[aria-sort="ascending"]::after { content: " ▲"; font-size: 8px; }
table.table th[aria-sort="descending"]::after { content: " ▼"; font-size: 8px; }
table.table tbody tr:hover { background: var(--hover); }
table.table tbody tr.link { cursor: pointer; }
table.table td.empty-cell { text-align: center; color: var(--muted); padding: 24px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; color: var(--ink3); font-size: 10.5px; flex-wrap: wrap; border-top: 1px solid var(--panel-border); }

table.compare { width: 100%; border-collapse: collapse; font-size: 13px; }
table.compare th, table.compare td { padding: 6px 8px; border-bottom: 1px solid var(--grid-line); text-align: left; vertical-align: top; }
table.compare tbody th { color: var(--ink3); font-weight: 500; white-space: nowrap; width: 110px; font-size: 12.5px; }
table.compare tr.same td { color: var(--good); }
.dup-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.cmp-head { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; color: var(--ink3); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; }
.cmp { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--grid-line); }

/* ------------------------------------------------------------------------ */
/* Person picker                                                             */
/* ------------------------------------------------------------------------ */

.picker { position: relative; }
.picker input { width: 100%; }
.picker-list { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: 300px; overflow: auto; margin: 0; padding: 4px; list-style: none; background: var(--panel-solid); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.picker-list li { display: flex; gap: 8px; align-items: center; padding: 7px 9px; cursor: pointer; font-size: 13px; }
.picker-list li:hover, .picker-list li.active { background: var(--accent-soft); }
.picker-list li small { margin-left: auto; color: var(--ink3); font-family: var(--mono); font-size: 10.5px; }
.picker-row { align-items: end; }
.swap { text-align: center; margin: -6px 0 10px; }

/* ------------------------------------------------------------------------ */
/* Charts                                                                    */
/* ------------------------------------------------------------------------ */

.chart-box { margin: 0; background: var(--panel); border: 1px solid var(--panel-border); padding: 20px 22px 14px; min-width: 0; }
.chart-cap { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.chart-cap small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; margin-top: 3px; }
.chart-actions, .export-btns { display: inline-flex; gap: 6px; flex: none; }
.chart-actions .btn, .export-btns .btn { padding: 4px 8px; font-family: var(--mono); font-size: 10px; font-weight: 400; color: var(--ink3); }
.chart-body { overflow-x: auto; }
svg.chart { width: 100%; height: auto; display: block; font-family: var(--mono); }
svg.chart text { fill: var(--muted); font-size: 10.5px; }
svg.chart text.muted { fill: var(--ink3); }
svg.chart .grid line { stroke: var(--grid-line); }
svg.chart .axis line { stroke: var(--line-strong); }
svg.chart .bar-group rect:not([fill="transparent"]):hover, svg.chart .hbar-row:hover rect:nth-of-type(2) { filter: brightness(1.2); }
.chart-tip, .map-tip { position: fixed; z-index: 60; background: var(--panel-solid); border: 1px solid var(--line-strong); padding: 7px 10px; font-size: 12.5px; box-shadow: var(--shadow); pointer-events: none; max-width: 280px; line-height: 1.4; }
.map-tip { position: absolute; }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin: 10px 0 0; align-items: center; }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }

/* ------------------------------------------------------------------------ */
/* Timeline                                                                  */
/* ------------------------------------------------------------------------ */

ol.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--line-strong); }
ol.timeline li { position: relative; padding: 4px 0 10px 12px; line-height: 1.5; font-size: 13.5px; }
ol.timeline li::before { content: ""; position: absolute; left: -17.5px; top: 11px; width: 7px; height: 7px; background: var(--accent); }
ol.timeline li.family::before { background: var(--accent-2); }
ol.timeline li.history::before { background: var(--info); }
ol.timeline li.history { color: var(--muted); }
.tl-year { display: inline-block; min-width: 46px; font-variant-numeric: tabular-nums; font-weight: 500; font-size: 12px; color: var(--accent-ink); margin-right: 4px; }
.tl-age { color: var(--ink3); font-size: 11.5px; font-family: var(--mono); margin-right: 4px; }
ol.stations { padding-left: 18px; }
ol.stations li { padding: 3px 0; }

.timeline-controls { background: var(--panel); border: 1px solid var(--panel-border); padding: 22px 24px 14px; margin-bottom: 12px; }
.timeline-controls .toolbar { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--panel-border); }
.timeline-main { display: flex; align-items: center; gap: 22px; }
.play-btn { width: 46px; height: 46px; flex: none; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font-size: 16px; cursor: pointer; display: grid; place-items: center; }
.play-btn:hover { filter: brightness(1.08); }
.slider-block { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.slider-ticks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--ink3); padding: 0 2px; }
.year-block { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 150px; text-align: right; }
.year-sub { font-family: var(--mono); font-size: 11px; color: var(--ink3); }
.year-big { font-size: 56px; font-weight: 800; color: var(--text); letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.slider-wrap { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; }
.year-slider { flex: 1; width: 100%; margin: 0; }
.year-range { font-variant-numeric: tabular-nums; min-width: 100px; font-size: 11px; color: var(--ink3); }
.timeline-details { margin-top: 12px; }
.history { border-color: rgba(114, 184, 242, 0.4); }

/* ------------------------------------------------------------------------ */
/* Person profile                                                            */
/* ------------------------------------------------------------------------ */

.person-header { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 22px; flex-wrap: wrap; }
.person-title { flex: 1 1 320px; }
.person-title h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; }
.person-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.person-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.avatar { width: 54px; height: 54px; display: grid; place-items: center; font-weight: 800; font-size: 22px; flex: none; }
.avatar.big { width: 68px; height: 68px; font-size: 28px; }
.avatar.M { background: var(--male); }
.avatar.F { background: var(--female); }
.avatar.U { background: var(--unknown); }
.avatar span { color: #0b0f13; }
.alt-names, .status-line { color: var(--muted); margin: 4px 0; font-size: 13.5px; }
.facts { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.facts li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 7px 0; border-top: 1px solid var(--panel-border); font-size: 13px; }
.facts li:first-child { border-top: 0; }
.facts .ico { color: var(--ink3); text-align: center; }
.rel-path { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 6px 0; }
.rel-step { display: inline-flex; flex-direction: column; align-items: center; color: var(--ink3); font-family: var(--mono); font-size: 10.5px; min-width: 40px; }
.rel-step .arrow { font-size: 16px; color: var(--accent); }
.rel-step.spouse .arrow { color: var(--accent-2); }
.repeated details { margin: 6px 0; }
.paths { margin-left: 10px; }
details.details summary { cursor: pointer; color: var(--accent-ink); margin: 6px 0; font-weight: 600; font-size: 13px; }
pre.raw, pre.gedcom { background: var(--bg-2); border: 1px solid var(--panel-border); padding: 12px; font-family: var(--mono); font-size: 11.5px; overflow: auto; max-height: 60vh; white-space: pre; }
.note, .notes p { white-space: pre-wrap; }

/* ------------------------------------------------------------------------ */
/* Biography – typeset life portrait                                         */
/* ------------------------------------------------------------------------ */

.bio-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 44px; align-items: start; }
.bio-article { max-width: 68ch; font-size: 16.5px; line-height: 1.72; color: var(--text); hyphens: auto; -webkit-hyphens: auto; font-variant-numeric: proportional-nums; }
.bio-article p { margin: 0 0 16px; text-wrap: pretty; }
.bio-article p:last-child { margin-bottom: 0; }
.bio-lede { font-size: 20px; line-height: 1.5; font-weight: 500; letter-spacing: -0.012em; margin: 4px 0 34px !important; color: var(--text); }
.bio-lede::first-letter { float: left; font-size: 68px; line-height: 0.8; padding: 7px 10px 0 0; font-weight: 800; color: var(--accent-ink); letter-spacing: -0.03em; }
.bio-chapter { margin: 0 0 40px; padding-top: 24px; border-top: 1px solid var(--panel-border); }
.bio-kicker { font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 8px; }
.bio-chapter h2 { font-size: 25px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; margin: 0 0 18px; }
.bio-self { font-weight: 700; }
.bio-article strong { font-weight: 700; }
.bio-article .plink { border-bottom: 1px solid var(--line-strong); }
.bio-article .plink:hover { border-bottom-color: var(--accent); }
.bio-years { font-family: var(--mono); font-size: 0.7em; color: var(--ink3); white-space: nowrap; letter-spacing: 0.01em; }
.bio-notes { margin: 8px 0 18px; }
.bio-quote { margin: 0 0 14px; padding: 4px 0 4px 18px; border-left: 2px solid var(--accent); color: var(--muted); font-size: 15px; line-height: 1.6; font-style: italic; }
.bio-quote p { white-space: pre-wrap; margin: 0; }
.bio-quote-ctx { display: block; font-style: normal; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink3); margin-bottom: 4px; }
.bio-colophon { margin-top: 26px; max-width: 68ch; }
/* Zeitgeschehen: chronicle style – the year is a small run-in marker, the event sentence stays intact. */
.bio-hist-year { font-family: var(--mono); font-size: 0.78em; font-weight: 600; letter-spacing: 0.02em; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.bio-hist-text { border-bottom: 1px dotted transparent; }
.bio-hist-text[title]:hover { border-bottom-color: var(--line-strong); cursor: help; }
.bio-history .provenance { margin-top: 18px; }
.bio-loading { font-style: italic; }
.bio-slot { min-width: 0; }
/* Biography embedded in the person profile: same typography, no sidebar. */
.bio-embed .bio-article { max-width: 72ch; }
.bio-embed .bio-chapter:first-child { border-top: 0; padding-top: 0; }
.bio-embed .bio-chapter { margin-bottom: 30px; }
.bio-embed .bio-chapter h2 { font-size: 21px; }
.section-actions { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bio-aside { position: sticky; top: 0; max-height: calc(100vh - 88px); overflow-y: auto; scrollbar-width: thin; }
.bio-cast { background: var(--panel); border: 1px solid var(--panel-border); padding: 18px 20px; }
.bio-cast .bio-kicker { margin-bottom: 14px; }
.bio-cast .rel-group:last-child { margin-bottom: 0; }
.bio-cast .rel-group h4 .muted { font-weight: 400; letter-spacing: 0; }
.bio-cast .chip { padding: 5px 10px 5px 8px; font-size: 12px; }
@media (max-width: 1100px) {
  .bio-layout { grid-template-columns: 1fr; gap: 26px; }
  .bio-aside { position: static; }
  .bio-article { max-width: none; }
}

/* ------------------------------------------------------------------------ */
/* Filter panel                                                              */
/* ------------------------------------------------------------------------ */

.filter-panel { position: fixed; top: var(--topbar-h); right: 0; bottom: 0; width: 340px; max-width: 100vw; z-index: 35; background: var(--bg-2); border-left: 1px solid var(--panel-border); box-shadow: var(--shadow); padding: 20px 20px; overflow-y: auto; }
.f-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.f-head h3 { flex: 1; font-size: 16px; }
.f-row { display: block; margin-bottom: 14px; }
.f-row > span { display: block; color: var(--ink3); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 6px; }
.f-row .input, .f-row .select, .f-row select { width: 100%; }
.f-range { display: flex; gap: 8px; align-items: center; }
.f-gens { display: flex; flex-wrap: wrap; gap: 4px; }
.gen-toggle { padding: 3px 8px; border: 1px solid var(--panel-border); background: transparent; color: var(--muted); cursor: pointer; font-family: var(--mono); font-size: 11px; }
.gen-toggle[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.f-info { color: var(--muted); font-size: 12.5px; margin-top: 14px; }
.filter-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid var(--accent); padding: 10px 14px; margin-bottom: 16px; font-size: 13px; color: var(--accent-ink); }
.panel-close { width: 30px; height: 30px; border: 1px solid var(--panel-border); background: transparent; color: var(--text); cursor: pointer; font-size: 18px; line-height: 1; display: grid; place-items: center; }
.panel-close:hover { background: var(--hover); }

/* ------------------------------------------------------------------------ */
/* Settings                                                                  */
/* ------------------------------------------------------------------------ */

.setting { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(220px, 1.2fr); gap: 16px; padding: 14px 0; border-top: 1px solid var(--panel-border); align-items: start; }
.setting-label strong { font-size: 13.5px; }
.setting-label p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.setting-control select, .setting-control .select { width: 100%; max-width: 420px; }
.admin-link { margin-top: 30px; font-size: 12.5px; }
.admin-link a { color: var(--ink3); }
.admin-card { max-width: 520px; }
.admin-form { display: flex; gap: 8px; margin-bottom: 10px; }
.admin-form input { flex: 1; }

/* ------------------------------------------------------------------------ */
/* Tree (3D + 2D)                                                            */
/* ------------------------------------------------------------------------ */

.tree-view { display: flex; flex-direction: column; gap: 12px; min-height: calc(100vh - var(--topbar-h) - 70px); }
.tree-view .page { display: contents; }
.tree-view .page-head { margin-bottom: 4px; }
.tree-view .toolbar { margin-bottom: 0; }
.tree-view .tree-body { min-height: 520px; height: calc(100vh - var(--topbar-h) - 290px); }
.tree-body { position: relative; flex: 1; min-height: 360px; display: flex; gap: 12px; }
.tree-stage { position: relative; flex: 1; overflow: hidden; border: 1px solid var(--panel-border); background: #0b0f13; min-width: 0; }
.tree-stage canvas { display: block; width: 100% !important; height: 100% !important; }
.tree-stage.svg { background: var(--panel); display: flex; flex-direction: column; }
.tree-stage .chart-actions { position: absolute; right: 12px; top: 9px; }
.tree-card-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--panel-border); font-family: var(--mono); font-size: 10.5px; color: var(--ink3); flex: none; min-height: 41px; }
svg.tree2d { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; flex: 1; min-height: 0; }
svg.tree2d:active { cursor: grabbing; }
svg.tree2d .node { cursor: pointer; }
svg.tree2d .node rect.pill { fill: var(--chip); stroke: transparent; stroke-width: 1.2; transition: stroke 0.15s; }
svg.tree2d .node.focus rect.pill { fill: var(--accent-soft); stroke: var(--accent); }
svg.tree2d .node:hover rect.pill, svg.tree2d .node:focus rect.pill { stroke: var(--accent); }
svg.tree2d .node.selected rect.pill { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 3; }
svg.tree2d .node.selected.focus rect.pill { stroke-dasharray: none; }
svg.tree2d .node:focus { outline: none; }
svg.tree2d .node text { font-family: var(--font); fill: var(--text); }
svg.tree2d .node text.years { fill: var(--ink3); font-family: var(--mono); }
svg.tree2d .node.out-of-scope { opacity: 0.35; }
svg.tree2d .node text.more { fill: var(--accent-2); font-weight: 800; }
svg.tree2d path.link { stroke: var(--line-strong); }
svg.tree2d path.link.spouse { stroke: var(--panel-border); }
svg.tree2d path.link.dim { stroke: var(--panel-border); }
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.node-label { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; padding: 3px 9px 4px; background: rgba(11, 15, 19, 0.8); border: 1px solid rgba(255, 255, 255, 0.12); color: #e9eef3; font-size: 12px; line-height: 1.2; white-space: nowrap; backdrop-filter: blur(6px); transition: opacity 0.25s ease; will-change: transform, opacity; }
.node-label .years { font-size: 10px; color: #9aa7b2; font-family: var(--mono); }
.node-label.selected { background: #8ee5cf; color: #06211c; font-weight: 700; font-size: 13px; border-color: #8ee5cf; }
.node-label.selected .years { color: #06211c; opacity: 0.75; }
.node-label.dimmed { display: none; }
.tree-panel { width: 300px; flex: none; background: var(--panel); border: 1px solid var(--panel-border); padding: 20px; overflow-y: auto; position: relative; }
.tree-panel .panel-close { position: absolute; right: 10px; top: 10px; }
.tree-panel .eyebrow { color: var(--ink3); margin-bottom: 10px; }
.tree-panel h2 { font-size: 20px; letter-spacing: -0.02em; line-height: 1.2; }
.tree-panel .sub { color: var(--muted); font-size: 12.5px; margin: 6px 0 14px; }
.modes { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.tree-side { padding: 0; border: 0; background: transparent; display: flex; flex-direction: column; gap: 12px; }
.side-card { padding: 20px; border: 1px solid var(--panel-border); background: var(--panel); display: flex; flex-direction: column; gap: 10px; }
.side-card.soft { background: var(--bg-2); }
.side-card .eyebrow { color: var(--ink3); }
.side-card h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.side-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.side-card .sub { font-family: var(--mono); font-size: 11px; color: var(--ink3); }
.facts-list { display: flex; flex-direction: column; }
.fact-row { display: flex; gap: 12px; padding: 8px 0; border-top: 1px solid var(--panel-border); font-size: 12.5px; }
.fact-row span { color: var(--ink3); min-width: 92px; }
.fact-row strong { margin-left: auto; text-align: right; font-weight: 600; }
.side-card .modes { margin-top: 6px; }
.tooltip { position: absolute; z-index: 5; pointer-events: none; background: rgba(11, 15, 19, 0.92); border: 1px solid rgba(255, 255, 255, 0.14); padding: 6px 10px; font-size: 12.5px; color: #e9eef3; max-width: 240px; }
.tooltip strong { display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .line { display: inline-block; width: 18px; height: 2px; }
.legend .line.child { background: var(--accent); }
.legend .line.spouse { background: var(--accent-2); }
.legend-hint { flex-basis: 100%; color: var(--ink3); font-family: var(--mono); font-size: 10.5px; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); background: rgba(11, 15, 19, 0.6); }

/* 3D controls hint */
.controls-hint { position: absolute; left: 14px; bottom: 14px; z-index: 4; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 12px; background: rgba(14, 20, 27, 0.92); border: 1px solid rgba(255, 255, 255, 0.14); color: #e9eef3; backdrop-filter: blur(8px); max-width: 300px; box-shadow: var(--shadow); transition: opacity 0.35s; }
.controls-hint.fade { opacity: 0; pointer-events: none; }
.controls-hint .eyebrow { color: #8ee5cf; }
.controls-hint ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.controls-hint li { display: flex; align-items: center; gap: 10px; font-size: 12.5px; line-height: 1.35; }
.controls-hint li svg { flex: none; }
.controls-hint li strong { font-weight: 700; }
.controls-hint li span { color: #9aa7b2; }
.controls-hint .btn { align-self: flex-start; margin-top: 2px; color: #e9eef3; border-color: rgba(255, 255, 255, 0.2); }
.controls-hint .btn:hover { border-color: #8ee5cf; color: #8ee5cf; }
.help-btn { width: 32px; justify-content: center; padding: 6px 0; font-weight: 800; }

/* network canvas */
.canvas-wrap { position: relative; border: 1px solid var(--panel-border); overflow: hidden; background: var(--panel); }
.canvas-wrap canvas { display: block; width: 100%; touch-action: none; }
.canvas-hint { position: absolute; left: 12px; bottom: 8px; color: var(--ink3); font-family: var(--mono); font-size: 10.5px; pointer-events: none; }

/* ------------------------------------------------------------------------ */
/* Map                                                                       */
/* ------------------------------------------------------------------------ */

.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.map-side:empty { display: none; }
.map-layout:has(.map-side:empty) { grid-template-columns: 1fr; }
.map-side { display: flex; flex-direction: column; gap: 12px; }
.map-wrap { position: relative; overflow: hidden; border: 1px solid var(--panel-border); background: var(--panel); }
.map-canvas { display: block; cursor: grab; touch-action: none; }
.map-overlay { position: absolute; inset: 0; pointer-events: none; }
.map-overlay > * { pointer-events: auto; }
.map-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; }
.map-zoom .btn { width: 30px; justify-content: center; padding: 3px 0; background: var(--panel); color: var(--text); }
.map-attr { position: absolute; right: 6px; bottom: 4px; font-size: 10px; color: var(--ink3); background: var(--panel); opacity: 0.9; padding: 1px 6px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin: 8px 0; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-types { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.map-types .check { font-size: 13px; }

/* ------------------------------------------------------------------------ */
/* Landing (welcome), progress, drop, toast                                  */
/* ------------------------------------------------------------------------ */

/* The landing page uses a softer, larger register than the app: 17px body copy,
   12–16px radii, one accent colour for actions (teal) and one warm accent for the
   optional family book. Muted text is a little darker here than in the app. */
.welcome {
  position: fixed; inset: var(--topbar-h) 0 0 0; overflow: auto; background: var(--bg);
  scrollbar-gutter: stable both-edges;
  font-size: 17px; line-height: 1.6;
  --muted: #a9b5c0; --ink3: #7f8b96;
  --l-radius: 12px; --l-radius-lg: 16px;
}
[data-theme="light"] .welcome { --muted: #3f4a55; --ink3: #545d66; }
.welcome .btn { border-radius: 10px; }
.welcome .btn.big { padding: 15px 26px; font-size: 16px; border-radius: var(--l-radius); white-space: normal; text-align: center; line-height: 1.25; max-width: 100%; }
.welcome .btn.outline { background: var(--panel); border: 1.5px solid var(--line-strong); color: var(--text); font-weight: 700; }
.welcome .btn.outline:hover { border-color: var(--accent); color: var(--accent-ink); }
.noscript { margin: 0; padding: 14px var(--l-pad); background: var(--amber-soft); border-bottom: 1px solid var(--amber-line); color: var(--text); font-size: 15px; }

/* Section heads: decorative mono eyebrow + a real heading. */
.l-head { margin-bottom: 32px; max-width: 780px; }
.l-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.l-eyebrow { margin: 0 0 12px; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink); }
.l-title { margin: 0; font-size: clamp(28px, 3.2vw, 40px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.12; }
.l-lead { margin: 14px 0 0; font-size: 17.5px; line-height: 1.6; color: var(--muted); }
.l-actions { display: flex; justify-content: center; margin-top: 30px; }
.landing-section { max-width: calc(var(--l-max) + 2 * var(--l-pad)); margin: 0 auto; padding: 80px var(--l-pad) 0; }
.landing-section:last-child { padding-bottom: 90px; }

/* Hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--panel-border); background: linear-gradient(180deg, var(--bg-2), var(--bg)); }
.hero-art { position: absolute; inset: 0; pointer-events: none; }
/* Soft colour panes, concentrated behind the product preview (right half). */
.hero-art .blob { position: absolute; filter: blur(70px); }
.hero-art .b1 { width: 620px; height: 520px; right: -6%; top: -18%; background: var(--c-teal); opacity: 0.28; transform: rotate(-14deg); }
.hero-art .b2 { width: 380px; height: 300px; right: 34%; bottom: -26%; background: var(--c-amber); opacity: 0.14; transform: rotate(12deg); }
.hero-art .b3 { width: 520px; height: 380px; right: 4%; bottom: -30%; background: var(--c-blue); opacity: 0.18; transform: rotate(-8deg); }
[data-theme="light"] .hero-art .b1 { opacity: 0.18; }
[data-theme="light"] .hero-art .b2 { opacity: 0.10; }
[data-theme="light"] .hero-art .b3 { opacity: 0.12; }
.hero-inner { position: relative; max-width: calc(var(--l-max) + 2 * var(--l-pad)); margin: 0 auto; padding: 64px var(--l-pad) 60px; display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 56px; align-items: center; }
/* The title is sized from its own column (container query units) so that the longest
   word – "Familiengeschichte" is ≈ 9 × font-size wide – always fits on one line.
   With background-clip:text any glyph outside the box would become invisible. */
.hero-copy { container-type: inline-size; min-width: 0; }
.hero-copy .l-eyebrow { margin-bottom: 18px; }
.hero h1 {
  font-size: clamp(34px, 9.6cqw, 56px); line-height: 1.06; font-weight: 800; letter-spacing: -0.04em;
  overflow-wrap: break-word; padding-bottom: 0.28em; margin-bottom: -0.12em;
  background: linear-gradient(100deg, var(--text) 30%, var(--accent-ink) 75%, var(--c-amber) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { margin: 22px 0 0; font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 50ch; }
.welcome-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 32px 0 0; }
.trust-line { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 18px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--ink3); }
.trust-line span { display: inline-flex; align-items: center; gap: 7px; }
.trust-line span::before { content: "✓"; color: var(--accent-ink); font-weight: 700; }
/* Compact file drop: still present, no longer the hero's main motif. */
.drop-zone { display: flex; align-items: center; gap: 14px; margin-top: 28px; padding: 14px 18px; max-width: 520px; border: 1px dashed var(--line-strong); border-radius: var(--l-radius); color: var(--accent-ink); background: color-mix(in srgb, var(--panel) 70%, transparent); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.drop-zone:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone svg { flex: none; }
.drop-zone .drop-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.drop-zone strong { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.35; }
.drop-zone .drop-text span { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.02em; color: var(--ink3); }

/* Product preview with selectable views */
.hero-preview { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.preview-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--panel-border); border-radius: 12px; background: var(--panel); }
.preview-tab { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14.5px; font-weight: 600; line-height: 1.2; padding: 9px 16px; border-radius: 9px; cursor: pointer; transition: background 0.15s, color 0.15s; }
.preview-tab:hover { color: var(--text); }
.preview-tab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.preview-frame { width: 100%; border: 1px solid var(--line-strong); border-radius: var(--l-radius-lg); overflow: hidden; background: var(--panel-solid); box-shadow: var(--shadow); }
.preview-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-bottom: 1px solid var(--panel-border); background: var(--bg-2); }
.preview-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.preview-bar span { margin-left: 8px; font-family: var(--mono); font-size: 11px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-shot { display: block; width: 100%; height: auto; aspect-ratio: 2400 / 1520; background: var(--bg); }
.preview-cta { align-self: flex-start; }

/* Provider logos directly below the hero */
.brands { padding-top: 64px; }
.brands .l-head { margin-bottom: 26px; }
.brand-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.brand-tile { display: flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; border: 1px solid var(--panel-border); border-radius: var(--l-radius); background: var(--panel); }
.brand-plate { display: grid; place-items: center; min-width: 56px; height: 40px; padding: 5px 8px; background: #fff; border: 1px solid rgba(15, 25, 35, 0.08); border-radius: 8px; }
.brand-logo { display: block; height: 28px; width: auto; max-width: 120px; object-fit: contain; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.brand-tile.more { padding: 8px 18px; border-style: dashed; background: transparent; min-height: 58px; }
.brand-tile.more a { font-size: 15px; font-weight: 700; }

/* Discover: one wide, two medium, three small panels with real views */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.bento-card { grid-column: span 3; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--panel-border); border-radius: var(--l-radius-lg); background: var(--panel); overflow: hidden; }
.bento-card.wide { grid-column: span 6; flex-direction: row; align-items: stretch; }
.bento-card.small { grid-column: span 2; }
.bento-text { padding: 26px 28px 22px; }
.bento-text h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.bento-text p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--muted); }
.bento-shot { position: relative; flex: 1; min-height: 250px; margin: 0; overflow: hidden; border-top: 1px solid var(--panel-border); background: var(--bg-2); }
.bento-shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.bento-shot img[data-shot="tree"] { object-position: center 54%; }
.bento-shot img[data-shot="map"] { object-position: left 64%; }
.bento-shot img[data-shot="statistics"] { object-position: left 46%; }
.bento-shot img[data-shot="quality"] { object-position: left 44%; }
.wide .bento-text { flex: 0 0 36%; display: flex; flex-direction: column; justify-content: center; padding: 36px 40px; }
.wide .bento-text h3 { font-size: 26px; }
.wide .bento-text p { font-size: 17px; }
.wide .bento-shot { min-height: 400px; border-top: 0; border-left: 1px solid var(--panel-border); }
.small .bento-text { padding: 22px 24px 18px; }
.small .bento-text h3 { font-size: 19px; }
.small .bento-text p { font-size: 15px; }
.small .bento-shot { min-height: 190px; }

/* Three steps: the numbers stay – they describe a sequence */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: start; align-content: start; padding: 26px 28px; border: 1px solid var(--panel-border); border-radius: var(--l-radius-lg); background: var(--panel); }
.step .num { grid-row: 1; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.step strong { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; align-self: center; }
.step span:last-child { grid-column: 2; font-size: 16px; line-height: 1.55; color: var(--muted); }

/* Why GEDCOM – text plus three plain facts, no boxes */
.why { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 56px; align-items: start; }
.why-text .l-title { margin-bottom: 20px; }
.why-text p:not(.l-eyebrow) { font-size: 17px; line-height: 1.65; color: var(--muted); max-width: 60ch; }
.why-facts { margin: 6px 0 0; border-top: 1px solid var(--line-strong); }
.why-facts div { padding: 18px 0; border-bottom: 1px solid var(--panel-border); }
.why-facts dt { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.why-facts dd { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--muted); }

/* All providers, uniform cards, export path folded away */
.platform-group { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink3); margin: 30px 0 12px; }
.platforms { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
/* Uniform cards: same logo plate, same name size; the export path folds out below. */
.platform { display: grid; grid-template-columns: 80px minmax(0, 1fr); grid-template-rows: auto auto; gap: 0 14px; align-items: center; padding: 14px 16px; background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--l-radius); transition: border-color 0.15s; }
.platform:hover { border-color: var(--line-strong); }
/* Logo plate: the vendor's own logo on white; falls back to the neutral monogram if the image is missing. */
.platform-mark { width: 80px; height: 48px; display: grid; place-items: center; padding: 5px; background: #fff; border: 1px solid rgba(15, 25, 35, 0.08); border-radius: 8px; font-family: var(--mono); font-weight: 700; font-size: 15px; letter-spacing: 0.02em; color: var(--c-ink); }
.platform-logo { display: block; width: auto; height: auto; max-width: 70px; max-height: 38px; object-fit: contain; }
.platform-abbr { display: none; }
.platform-mark.fallback { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.platform-mark.fallback .platform-logo { display: none; }
.platform-mark.fallback .platform-abbr { display: block; }
.platform-name { font-weight: 700; font-size: 16.5px; letter-spacing: -0.01em; line-height: 1.3; }
.platform-howto { grid-column: 1 / -1; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--panel-border); }
.platform-howto summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; color: var(--accent-ink); }
.platform-howto summary::-webkit-details-marker { display: none; }
.platform-howto summary::after { content: "+"; flex: none; font-size: 18px; font-weight: 400; line-height: 1; }
.platform-howto[open] summary::after { content: "–"; }
.platform-path { margin: 8px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.legal-note { margin-top: 26px; padding: 16px 18px; border: 1px dashed var(--line-strong); border-radius: var(--l-radius); font-size: 13px; color: var(--ink3); line-height: 1.55; }
.legal-note p { margin: 0 0 8px; }
.legal-note p:last-child { margin: 0; }

/* Family book: the one warm accent on the page */
.book-promo { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 44px; align-items: center; padding: 48px 52px; border: 1px solid var(--amber-line); border-radius: var(--l-radius-lg); background: linear-gradient(135deg, var(--amber-soft), transparent 65%), var(--panel); box-shadow: var(--shadow); }
.book-promo-art { display: grid; place-items: center; padding: 10px 0; }
.mini-book { position: relative; width: 200px; aspect-ratio: 210 / 297; padding: 26px 24px; display: flex; flex-direction: column; gap: 6px; color: #f3eee4; background: linear-gradient(160deg, #3d261b, #241613 70%); border-radius: 3px 10px 10px 3px; box-shadow: 0 28px 60px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.06); transform: rotate(-4deg); }
.mini-book::before { content: ""; position: absolute; left: 9px; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, 0.14); }
.mini-eyebrow { font-family: var(--mono); font-size: 8px; letter-spacing: 0.22em; text-transform: uppercase; color: #d9a441; }
.mini-title { margin-top: 36px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.mini-years { font-family: var(--mono); font-size: 10.5px; color: #d9a441; }
.mini-rule { height: 1px; background: rgba(255, 255, 255, 0.2); margin: 14px 0 10px; }
.mini-meta { font-size: 9px; line-height: 1.5; color: #c9b89a; }
.book-promo-text .l-eyebrow { color: var(--c-gold); }
.book-promo-text .l-title { margin-bottom: 16px; font-size: clamp(26px, 2.8vw, 36px); }
.book-promo-text .l-title [data-book-price] { color: var(--accent-2); white-space: nowrap; }
.book-promo-text p { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 62ch; }
.book-promo-text .btn { margin-top: 12px; }
.welcome[data-book-mode="local"] .if-paid, .welcome:not([data-book-mode="local"]) .if-local { display: none !important; }
.welcome[data-book-mode="off"] #book-offer { display: none !important; }

/* FAQ */
.faq { display: grid; gap: 10px; max-width: 920px; }
.faq-item { background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--l-radius); padding: 0 24px; }
.faq-item[open] { border-color: var(--line-strong); }
.faq-item summary { cursor: pointer; padding: 18px 0; font-weight: 700; font-size: 17.5px; line-height: 1.35; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent-ink); font-weight: 400; font-size: 24px; line-height: 1; flex: none; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin: 0 0 18px; color: var(--muted); font-size: 16.5px; line-height: 1.6; max-width: 84ch; }

/* Closing */
.cta { padding: 48px 44px; border: 1px solid var(--line-strong); border-radius: var(--l-radius-lg); background: linear-gradient(120deg, var(--bg-2), var(--accent-soft)); display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.cta .l-title { font-size: clamp(26px, 2.8vw, 34px); }
.cta p { margin: 12px 0 0; font-size: 17px; color: var(--muted); max-width: 46ch; }
.cta .welcome-actions { margin: 0; }
.footer { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 28px; font-size: 14px; color: var(--ink3); }
.footer a { color: var(--ink3); }
.footer a:hover { color: var(--text); }
.footer-legal { display: contents; }

.progress { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(11, 15, 19, 0.6); backdrop-filter: blur(4px); }
.progress-box { background: var(--panel-solid); border: 1px solid var(--line-strong); padding: 24px 30px; min-width: 300px; text-align: center; box-shadow: var(--shadow); }
.progress-track { height: 6px; background: var(--chip); overflow: hidden; margin-top: 10px; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--chip); border-top-color: var(--accent); animation: spin 0.9s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Anmeldelink auf anderem Gerät: E-Mail bestätigen */
.auth-dialog { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; background: rgba(11, 15, 19, 0.6); backdrop-filter: blur(4px); padding: 16px; }
.auth-dialog-box { background: var(--panel-solid); border: 1px solid var(--line-strong); padding: 22px 26px; width: min(92vw, 420px); box-shadow: var(--shadow); display: grid; gap: 10px; }
.auth-dialog-box h2 { margin: 0; font-size: 18px; }
.auth-dialog-box p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.auth-dialog-box input { width: 100%; font-size: 14px; }
.auth-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* Korrekturen: Dialog (Person/Familie) und schwebender Hinweis mit Download */
.edit-dialog { border: 1px solid var(--line-strong); background: var(--panel-solid); color: var(--text); padding: 0; width: min(94vw, 820px); max-height: 92vh; box-shadow: var(--shadow); }
.edit-dialog::backdrop { background: rgba(11, 15, 19, 0.6); backdrop-filter: blur(4px); }
.edit-dialog form { display: grid; gap: 14px; padding: 22px 26px 18px; max-height: 92vh; overflow-y: auto; box-sizing: border-box; }
.edit-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.edit-head h2 { margin: 0; font-size: 20px; }
.edit-head p { margin: 4px 0 0; }
.edit-head .tabs { margin: 0; }
.edit-form { display: grid; gap: 12px; }
.edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.edit-field { display: grid; gap: 5px; min-width: 0; }
.edit-label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.edit-field .input, .edit-field .select, .edit-field input { width: 100%; box-sizing: border-box; }
.edit-hint { font-size: 12px; color: var(--muted); line-height: 1.45; margin: 0; }
.edit-event { border: 1px solid var(--panel-border); padding: 10px 12px 12px; margin: 0; display: grid; gap: 8px; min-width: 0; }
.edit-event legend { font-weight: 700; font-size: 13px; padding: 0 6px; display: flex; gap: 8px; align-items: center; }
.edit-event legend code { font-family: var(--mono); font-size: 10.5px; color: var(--muted); font-weight: 400; }
.edit-date { display: grid; gap: 3px; }
.edit-preview { font-family: var(--mono); font-size: 11px; color: var(--good); min-height: 14px; }
.edit-preview.bad { color: var(--bad); }
.edit-dialog input.invalid { border-color: var(--bad); }
.edit-raw-box { display: grid; gap: 8px; }
.edit-raw-box p { margin: 0; }
.edit-raw { width: 100%; box-sizing: border-box; font-family: var(--mono); font-size: 12px; line-height: 1.5; white-space: pre; overflow: auto; resize: vertical; }
.edit-errors { margin: 0; padding: 8px 12px 8px 28px; border: 1px solid var(--bad); background: rgba(240, 122, 122, 0.08); font-size: 12.5px; color: var(--text); }
.edit-error { margin: 0; padding: 10px 14px; border: 1px solid var(--bad); background: rgba(240, 122, 122, 0.08); font-size: 13px; white-space: pre-wrap; }
.edit-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 2px; }
.edit-pill { position: fixed; right: 22px; bottom: 22px; z-index: 45; display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 14px; background: var(--panel-solid); border: 1px solid var(--accent); box-shadow: var(--shadow); font-size: 12.5px; max-width: min(92vw, 560px); }
.edit-pill-text { display: flex; gap: 6px; align-items: baseline; white-space: nowrap; }
pre.gedcom.small { font-size: 10.5px; max-height: 160px; margin: 0; }
@media print { .edit-pill { display: none; } }

.drop-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(11, 15, 19, 0.7); backdrop-filter: blur(3px); }
.drop-box { padding: 40px 60px; border: 2px dashed var(--accent); font-size: 22px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; max-width: min(90vw, 620px); padding: 11px 18px; background: var(--bad); color: #fff; box-shadow: var(--shadow); font-size: 13.5px; }
.toast.info { background: var(--panel-solid); color: var(--text); border: 1px solid var(--line-strong); }
.toast.warn { background: var(--accent-2); color: #1a1400; }

.error-box { background: rgba(240, 122, 122, 0.08); border: 1px solid var(--bad); padding: 16px; }
.error-box pre { white-space: pre-wrap; font-size: 12px; font-family: var(--mono); }

/* ------------------------------------------------------------------------ */
/* Responsive                                                                */
/* ------------------------------------------------------------------------ */

@media (max-width: 1100px) {
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-layout { grid-template-columns: 1fr; }
  .dup-list { grid-template-columns: 1fr; }
  .view { padding: 26px 24px 80px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; }
  .hero-preview { max-width: 820px; }
  .hero-art .b1 { right: -20%; top: 30%; }
  .hero-art .b3 { right: -10%; bottom: -10%; }
  .wide .bento-text { flex-basis: 42%; padding: 30px 32px; }
  .wide .bento-shot { min-height: 340px; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform 0.2s; z-index: 25; box-shadow: var(--shadow); }
  .why, .book-promo, .steps { grid-template-columns: minmax(0, 1fr); }
  .why { gap: 32px; }
  .book-promo { padding: 30px 24px; gap: 28px; }
  .mini-book { max-width: 100%; }
  .bento-card, .bento-card.wide { grid-column: span 6; flex-direction: column; }
  .bento-card.small { grid-column: span 3; }
  .wide .bento-text { flex-basis: auto; padding: 26px 28px 22px; }
  .wide .bento-shot { min-height: 260px; border-left: 0; border-top: 1px solid var(--panel-border); }
  .bento-shot, .small .bento-shot { min-height: 200px; }
  .sidebar.open { transform: none; }
  .topbar { --topbar-pad: 14px; gap: 10px; }
  .topbar .nav-toggle { display: inline-flex; }
  .file-label, .topbar .divider { display: none; }
  .search { flex-basis: 160px; }
  .view { padding: 18px 14px 70px; }
  .grid.two, .grid.four, .grid.three { grid-template-columns: 1fr; }
  .tree-body { flex-direction: column; }
  .tree-panel { width: auto; max-height: 40%; }
  .setting { grid-template-columns: 1fr; }
  .edit-grid { grid-template-columns: 1fr; }
  .edit-pill { right: 10px; left: 10px; bottom: 10px; max-width: none; flex-wrap: wrap; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { text-align: left; border-top: 0; padding-top: 0; }
  .page-head h1 { font-size: 28px; }
  .year-big { font-size: 38px; }
  .timeline-main { flex-wrap: wrap; }
  .year-block { align-items: flex-start; text-align: left; width: 100%; }
  .stat-value { font-size: 32px; }
  .welcome { --l-pad: 20px; font-size: 16px; }
  .hero-inner { padding: 40px var(--l-pad) 40px; gap: 32px; }
  .hero .lead { font-size: 17px; }
  .landing-section { padding: 56px var(--l-pad) 0; }
  .brands { padding-top: 48px; }
  .l-head { margin-bottom: 24px; }
  .welcome .btn.big { padding: 14px 20px; font-size: 15.5px; }
  .drop-zone { max-width: none; }
  .brand-tile { padding: 6px 14px 6px 6px; gap: 10px; }
  .brand-name { font-size: 15px; }
  .cta { padding: 30px 24px; }
  .filter-panel { width: 100vw; }
  .controls-hint { left: 8px; right: 8px; bottom: 8px; max-width: none; }
}
@media (max-width: 600px) {
  /* Narrow screens: keep the gutter on one edge only. */
  .welcome { scrollbar-gutter: stable; }
  .bento-card.small { grid-column: span 6; }
  .step { padding: 22px 20px; }
  .book-promo { padding: 26px 18px; }
  .platforms { grid-template-columns: 1fr; }
  .faq-item { padding: 0 18px; }
  .preview-tabs { display: flex; }
  .preview-tab { flex: 1 1 auto; text-align: center; padding: 8px 12px; font-size: 13.5px; }
}
@media (max-width: 360px) {
  /* Only very narrow screens cannot fit "Familiengeschichte" at the minimum size: hyphenate instead of breaking mid-word. */
  .hero h1 { hyphens: auto; -webkit-hyphens: auto; }
}
@media (max-width: 520px) {
  .topbar { --topbar-pad: 8px; gap: 8px; }
  .brand .brand-name { display: none; }
  .actions .btn.primary { padding: 6px 10px; font-size: 12px; }
  body:not(.has-data) .topbar .btn.primary { padding: 8px 12px; font-size: 13px; }
}
@media (max-width: 620px) {
  body:not(.has-data) .topbar .nav-toggle { display: none; }
  .topbar .actions .btn.primary { white-space: normal; min-width: 0; text-align: center; line-height: 1.25; }
  body.has-data { --topbar-h: 106px; }
  body.has-data .topbar { flex-wrap: wrap; align-content: center; gap: 6px 8px; }
  body.has-data .topbar .brand { display: none; }
  body.has-data .topbar .nav-toggle { flex: none; }
  body.has-data .topbar .actions { flex: 1; justify-content: flex-end; min-width: 0; }
  body.has-data .topbar .actions .btn { padding-left: 8px; padding-right: 8px; }
  body.has-data .topbar .actions .btn.primary { flex: 1 1 auto; }
  body.has-data .search { order: 1; flex: 0 0 100%; max-width: none; min-width: 0; }
  body.has-data .search input { height: 36px; }
  body.has-data .search::before { top: 17px; }
  body.has-data .search::after { top: 9px; }
}

/* ------------------------------------------------------------------------ */
/* Legal pages                                                               */
/* ------------------------------------------------------------------------ */

body[data-view="legal"] .app { grid-template-columns: 1fr; }
body[data-view="legal"] .sidebar,
body[data-view="legal"] .topbar .nav-toggle { display: none; }
.legal-page { max-width: 74ch; margin: 0 auto; }
.legal-page h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 8px; }
.legal-page h2 { font-size: 18px; letter-spacing: -0.02em; margin: 1.75em 0 0.45em; }
.legal-page p, .legal-page li { line-height: 1.65; }
.legal-page ul { margin: 0.4em 0 0.8em; padding-left: 1.2em; }
.legal-page a { color: var(--accent-ink); }
.legal-kicker, .legal-note, .legal-back { color: var(--muted); }
.legal-kicker { margin: 0 0 8px; }
.legal-back { margin: 0 0 22px; }
.legal-switch { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.legal-switch button {
  padding: 6px 12px; border: 1px solid var(--panel-border); background: transparent;
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.legal-switch button.is-current { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.legal-nav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--panel-border); }
.legal-nav a { color: var(--muted); text-decoration: none; font-weight: 700; }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.legal-nav a:hover { color: var(--text); }
.legal-nav a[aria-current="page"] { color: var(--accent-ink); }
.legal-dl { display: grid; grid-template-columns: minmax(9rem, 15rem) minmax(0, 1fr); gap: 6px 16px; margin: 8px 0 14px; }
.legal-dl dt { color: var(--muted); }
.legal-dl dd { margin: 0; }
.legal-form {
  white-space: pre-wrap; font-family: var(--font); font-size: 13.5px; line-height: 1.55;
  border: 1px solid var(--panel-border); background: var(--panel); padding: 16px 18px; margin: 8px 0 0;
}
@media (max-width: 640px) {
  .legal-dl { grid-template-columns: 1fr; gap: 2px; }
  .legal-dl dt { margin-top: 8px; }
}

/* ------------------------------------------------------------------------ */
/* Print                                                                     */
/* ------------------------------------------------------------------------ */

@media print {
  :root { --bg: #fff; --bg-2: #fff; --panel: #fff; --panel-solid: #fff; --panel-border: #bbb; --line-strong: #999; --text: #000; --muted: #444; --ink3: #666; --grid-line: #ddd; --chip: #f0f0f0; }
  html, body { overflow: visible; height: auto; background: #fff; color: #000; }
  .topbar, .sidebar, .filter-panel, .toast, .progress, .drop-overlay, .chart-actions, .toolbar, .tabs, .table-foot, .btn, .filter-strip, .map-zoom, .nav-toggle, .controls-hint, .legal-switch { display: none !important; }
  .app { position: static; display: block; }
  .view { overflow: visible; padding: 0; }
  .card, .stat, .chart-box, .table-wrap { break-inside: avoid; box-shadow: none; }
  a { color: #000; }
  svg.chart text { fill: #000; }
  .bio-layout { display: block; }
  .bio-aside, .bio-colophon, .page-actions { display: none !important; }
  .bio-article { max-width: none; font-size: 11.5pt; line-height: 1.6; }
  .bio-lede::first-letter { color: #000; }
  .bio-kicker { color: #444; }
  .bio-chapter { break-inside: auto; }
  .bio-chapter h2 { break-after: avoid; }
  .bio-article .plink { border-bottom: 0; }
  .bio-quote { color: #333; border-left-color: #999; }
  .bio-hist-year { color: #000; }
  .bio-history .provenance { color: #444; }
}
