/* ~/stammbaum: Kachel (Mini-Baum), Ansicht (Bühne, Detail, Dialoge), Lebensstationen, Familien-Zeitleiste und Familienbuch (Druck).
   Nur Tokens aus foundation.css; Generationsfarben kommen aus der Palette (--fv-*) über --c am Knoten. Dunkle Themes leuchten
   (--fx-glow), helle bleiben ruhig ([data-mode="light"]). Hover nur bei (hover: hover). Bewegung: Auftakt und Gleiten nur, wenn
   Bewegung an ist (prefers-reduced-motion und data-motion wie in uebersicht.css Abschnitt 11). */

/* ---------- 1 · Bühne (SVG) – gilt für Kachel und Ansicht ---------- */
.fb-svg { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; outline: none; }
.fb-svg:active { cursor: grabbing; }
.fb-svg.mini { touch-action: auto; cursor: pointer; pointer-events: none; }
.fb-world.glide { transition: transform .42s var(--ease); }
.fb-rowline { stroke: color-mix(in srgb, var(--text) 7%, transparent); stroke-width: 1; stroke-dasharray: 2 6; }
.fb-rowlab { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; fill: var(--faint); }
/* Eltern → Kind: weiche Kurve in der Farbe der Kind-Generation, mit Schein im Dunkeln */
.fb-edge { fill: none; stroke: color-mix(in srgb, var(--c, var(--dim)) 70%, var(--line)); stroke-width: 1.6; stroke-linecap: round;
  filter: drop-shadow(0 0 calc(5px * var(--fx-glow)) color-mix(in oklab, var(--c, var(--acc)) 45%, transparent)); }
.fb-edge.k-adoptiv, .fb-edge.k-stief, .fb-edge.k-pflege { stroke-dasharray: 5 4; }
.fb-edge.ghost { stroke: var(--faint); stroke-dasharray: 3 5; stroke-width: 1.2; opacity: .55; filter: none; }
/* Partner: Linie zwischen den Kreisen; getrennt/geschieden gestrichelt und leiser */
.fb-couple { stroke: color-mix(in srgb, var(--text) 55%, var(--line)); stroke-width: 1.8; stroke-linecap: round; }
.fb-couple.dashed { stroke-dasharray: 4 5; stroke: var(--dim); opacity: .7; }
.fb-couple.ghost { stroke: var(--faint); stroke-dasharray: 3 5; stroke-width: 1.2; opacity: .55; }
.fb-cmark { cursor: pointer; }
.fb-cmark circle { fill: var(--surf); stroke: color-mix(in srgb, var(--text) 35%, var(--line)); stroke-width: 1; }
.fb-cmark text { font-size: 9px; fill: var(--dim); pointer-events: none; }
.fb-cmark.k-verheiratet text, .fb-cmark.k-partner text { fill: var(--fv-8); }
.fb-cmark.k-verwitwet text { fill: var(--faint); }
@media (hover: hover) { .fb-cmark:hover circle { stroke: var(--acc); } }
/* Person: Hof (Schein), Ring in der Generationsfarbe, Glasfläche, Initialen oder Foto */
.fb-node { cursor: pointer; outline: none; }
.fb-halo { fill: var(--c, var(--acc)); opacity: 0; transition: opacity var(--t-slow); }
.fb-ring { fill: none; stroke: var(--c, var(--acc)); stroke-width: 1.5; opacity: .75;
  filter: drop-shadow(0 0 calc(8px * var(--fx-glow)) color-mix(in oklab, var(--c, var(--acc)) 55%, transparent)); }
.fb-face { stroke: color-mix(in srgb, var(--c, var(--acc)) 40%, transparent); stroke-width: .6; }
.fb-face { fill-opacity: 1; }
/* Grundfläche unter dem Verlauf: die Bühne scheint durch, deshalb ein deckender Kreis dahinter per Filter-Trick nicht nötig – der Ring begrenzt */
.fb-gloss { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: 1; }
.fb-ini { font-family: var(--ui); font-size: 20px; font-weight: 600; letter-spacing: -.02em; fill: var(--text); pointer-events: none; }
.fb-l1 { font-family: var(--ui); font-size: 13px; font-weight: 600; fill: var(--text); pointer-events: none; }
.fb-l2 { font-family: var(--ui); font-size: 11.5px; fill: var(--dim); pointer-events: none; }
.fb-l3 { font-family: var(--mono); font-size: 10.5px; fill: var(--faint); pointer-events: none; }
.fb-cross { font-size: 11px; fill: var(--dim); }
.fb-hit { fill: transparent; }
.fb-node.ich .fb-ring { stroke-width: 2.2; opacity: 1; }
.fb-node.ich .fb-halo { opacity: .08; }
.fb-node.sel .fb-halo { opacity: .18; }
.fb-node.sel .fb-ring { stroke-width: 2.6; opacity: 1; stroke: var(--text); }
.fb-node.sel .fb-l1 { fill: var(--acc); }
.fb-node:focus-visible .fb-ring { stroke: var(--focus); stroke-width: 2.6; }
@media (hover: hover) { .fb-node:hover .fb-halo { opacity: .14; } .fb-node:hover .fb-l1 { fill: var(--acc); } }
/* Platzhalter: gestrichelter Kreis mit Plus – einladend, nicht aufdringlich */
.fb-ghost { cursor: pointer; outline: none; }
.fb-gface { fill: color-mix(in srgb, var(--text) 3%, transparent); stroke: var(--faint); stroke-width: 1.2; stroke-dasharray: 4 4; transition: stroke var(--t-fast), fill var(--t-fast); }
.fb-plus { font-family: var(--ui); font-size: 22px; font-weight: 300; fill: var(--faint); pointer-events: none; }
.fb-gl { font-family: var(--ui); font-size: 11px; fill: var(--faint); pointer-events: none; }
.fb-ghost:focus-visible .fb-gface { stroke: var(--focus); }
@media (hover: hover) { .fb-ghost:hover .fb-gface { stroke: var(--acc); fill: color-mix(in srgb, var(--acc) 8%, transparent); } .fb-ghost:hover .fb-plus, .fb-ghost:hover .fb-gl { fill: var(--acc); } }
/* Kachel: kleinere Schrift, kein Zeiger */
.fb-svg.mini .fb-ini { font-size: 18px; }
.fb-svg.mini .fb-ring { stroke-width: 2; }
.fb-svg.mini .fb-plus { font-size: 20px; }
/* Auftakt: Knoten erscheinen von „ich“ aus nach außen (Verzögerung --d je Generation) */
@keyframes fb-in { from { opacity: 0; transform: translate(var(--tx, 0), var(--ty, 0)) scale(.6); } }
.fb-node.in, .fb-ghost.in { animation: fb-in .55s var(--ease) both; animation-delay: var(--d, 0ms); transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: reduce) { :root:not([data-motion="an"]) :is(.fb-node.in, .fb-ghost.in) { animation: none; } :root:not([data-motion="an"]) .fb-world.glide { transition: none; } }
:root[data-motion="aus"] :is(.fb-node.in, .fb-ghost.in) { animation: none; }
:root[data-motion="aus"] .fb-world.glide { transition: none; }

/* ---------- 2 · Kachel auf der Übersicht ---------- */
.fb-tile { gap: var(--sp-2); }
.fb-mini { position: relative; display: block; height: 230px; border: 1px solid var(--line); border-radius: var(--r-inner); overflow: hidden; text-decoration: none; color: inherit;
  background: radial-gradient(110% 80% at 30% 0%, color-mix(in oklab, var(--acc) 9%, var(--page)) 0%, var(--page) 60%), var(--page); }
.fb-mini::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 100% at 50% 50%, transparent 62%, color-mix(in srgb, var(--page) 70%, transparent)); }
@media (hover: hover) { .fb-mini:hover { border-color: color-mix(in srgb, var(--acc) 55%, var(--line)); } }
.fb-mini-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-1); height: 150px; padding: var(--sp-4); text-align: center; color: var(--dim); font-size: var(--fs-sm); }
.fb-mini-empty b { color: var(--text); font-size: var(--fs-body); }
.fb-tile-foot { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); font-size: var(--fs-sm); color: var(--dim); }
.fb-tile-foot b { color: var(--text); font-family: var(--mono); }
.fb-tile-gap { color: var(--acc); }
@container tile (max-width: 440px) { .fb-mini { height: 190px; } }

/* ---------- 3 · Ansicht: Kopf, Bühne, Detail ---------- */
.fb-page { display: flex; flex-direction: column; gap: var(--sp-3); flex: 1 1 auto; min-height: 0; }
.fb-head { flex-wrap: wrap; gap: var(--sp-2); }
.fb-head-r { flex-wrap: wrap; gap: var(--sp-2); margin-left: auto; }
.fb-stats { color: var(--dim); font-size: var(--fs-sm); }
.fb-seg button { display: inline-flex; align-items: center; gap: 6px; }
.fb-seg kbd { font-size: 10px; color: var(--faint); }
.fb-seg button.on kbd { color: var(--acc); }
.fb-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-3); flex: 1 1 auto; min-height: min(72vh, 760px); }
.fb-stage { position: relative; min-height: 420px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--page);
  background-image: radial-gradient(120% 90% at 30% 0%, color-mix(in oklab, var(--acc) 7%, var(--page)) 0%, transparent 60%); }
.fb-stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(130% 100% at 50% 50%, transparent 65%, color-mix(in srgb, var(--page) 70%, transparent)),
    repeating-linear-gradient(to bottom, transparent 0 2px, var(--scan, transparent) 2px 3px); }
.fb-stage-host { position: absolute; inset: 0; }
.fb-zoom { position: absolute; right: 10px; top: 10px; z-index: 2; display: flex; flex-direction: column; gap: 4px; }
.fb-zoom .btn { min-width: 34px; padding: 4px 8px; background: color-mix(in srgb, var(--surf) 85%, transparent); backdrop-filter: blur(4px); }
.fb-cap { position: absolute; left: 12px; bottom: 10px; z-index: 2; font-size: var(--fs-micro); pointer-events: none; }
.fb-msg { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; padding: var(--sp-4); }
.fb-msgbox { max-width: 460px; gap: var(--sp-3); box-shadow: var(--shadow); }
.fb-detail { min-height: 0; overflow-y: auto; gap: var(--sp-2); }
.fb-detail h3 { gap: var(--sp-2); }
.fb-detail h3 .pill { margin-right: auto; }
.fb-x { margin-left: auto; padding: 2px 8px; }
.fb-detail h3 .pill + .fb-x, .fb-detail h3 .fb-chip + .fb-x { margin-left: 0; }
.fb-detail h3 > :first-child { margin-right: auto; }
.fb-detail h3 .pill { margin-right: 0; }
.fb-hint { font-size: var(--fs-sm); line-height: 1.45; }
.fb-chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-meta); color: var(--dim); font-weight: 500; }
.fb-dot { display: inline-block; width: 8px; height: 8px; border-radius: var(--r-full); background: var(--c, var(--acc)); box-shadow: 0 0 calc(8px * var(--fx-glow)) var(--c, var(--acc)); }
.fb-sec { display: flex; flex-direction: column; gap: 4px; padding-top: var(--sp-2); border-top: 1px solid var(--line); }
.fb-sec h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 2px; font-size: var(--fs-micro); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.fb-sec h4 .btn { margin-left: auto; letter-spacing: 0; text-transform: none; font-weight: 500; padding: 1px 8px; min-height: 0; }
.fb-sec h4 .faint { letter-spacing: 0; }
/* Avatar als HTML (Detail, Listen, Buch) */
.fb-av { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: var(--r-full); overflow: hidden; font-weight: 600; font-size: var(--fs-sm); color: var(--text);
  background: radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--c, var(--acc)) 45%, var(--surf)) 0%, color-mix(in srgb, var(--c, var(--acc)) 14%, var(--surf)) 70%);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c, var(--acc)) 75%, transparent), 0 0 calc(10px * var(--fx-glow)) color-mix(in oklab, var(--c, var(--acc)) 35%, transparent); }
.fb-av img { width: 100%; height: 100%; object-fit: cover; }
.fb-av.sm { width: 28px; height: 28px; font-size: var(--fs-micro); }
.fb-av.lg { width: 72px; height: 72px; font-size: 24px; }
.fb-av.ghost { background: none; box-shadow: inset 0 0 0 1.5px var(--faint); color: var(--faint); border: 0; font-weight: 300; font-size: 18px; }
.fb-hero { display: flex; gap: var(--sp-3); align-items: center; }
.fb-hero-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: var(--fs-sm); color: var(--dim); }
.fb-name { font-size: var(--fs-title); font-weight: 650; letter-spacing: -.02em; line-height: 1.15; color: var(--text); overflow-wrap: anywhere; }
.fb-aka { font-size: var(--fs-sm); }
.fb-dates { color: var(--text); }
.fb-acts { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); align-items: center; }
.fb-acts .btn.danger { color: var(--red); }
.fb-foot { padding-top: var(--sp-2); border-top: 1px solid var(--line); }
.fb-notiz { font-size: var(--fs-sm); line-height: 1.5; color: var(--dim); }
.fb-md p { margin: 0 0 6px; } .fb-md p:last-child { margin-bottom: 0; }
.fb-md h1, .fb-md h2, .fb-md h3 { font-size: var(--fs-body); margin: 8px 0 4px; color: var(--text); }
.fb-md ul, .fb-md ol { margin: 4px 0; padding-left: 1.3em; }
.fb-md img { max-width: 100%; border-radius: var(--r-row); }
.fb-rel { display: flex; align-items: center; gap: var(--sp-1); }
.fb-rel .fb-pb { flex: 1; }
.fb-unlink { color: var(--faint); min-width: 28px; padding: 2px 6px; }
.fb-pb { display: flex; align-items: center; gap: var(--sp-2); width: 100%; min-height: max(32px, var(--tap)); padding: 3px 6px; border: 0; border-radius: var(--r-row); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.fb-pb-n { font-weight: 500; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fb-pb .faint { font-size: var(--fs-meta); white-space: nowrap; }
.fb-pb.ghost .fb-pb-n { color: var(--dim); font-weight: 400; }
@media (hover: hover) { .fb-pb:hover { background: color-mix(in srgb, var(--text) 6%, transparent); } .fb-pb:hover .fb-pb-n { color: var(--acc); } }
.fb-empty { font-size: var(--fs-sm); padding: 2px 6px; }

/* ---------- 4 · Lebensstationen (Zeitleiste im Detail) ---------- */
.fb-filter { align-self: flex-start; flex-wrap: wrap; margin: 2px 0 4px; }
.fb-filter button { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; font-size: var(--fs-meta); }
.fb-filter button small { font-family: var(--mono); font-size: 10px; color: var(--faint); }
.fb-filter button.on small { color: var(--acc); }
.fb-filter button:disabled { opacity: .4; cursor: default; }
.fb-tl { list-style: none; margin: 0; padding: 0 0 0 14px; position: relative; display: flex; flex-direction: column; gap: 2px; }
.fb-tl::before { content: ''; position: absolute; left: 4px; top: 10px; bottom: 10px; width: 1px; background: linear-gradient(180deg, transparent, var(--line) 8%, var(--line) 92%, transparent); }
.fb-st { position: relative; }
.fb-st::before { content: ''; position: absolute; left: -14px; top: 14px; width: 9px; height: 9px; border-radius: var(--r-full); background: var(--c, var(--dim)); box-shadow: 0 0 calc(8px * var(--fx-glow)) var(--c, var(--dim)); }
.fb-st.k-wohnort { --c: var(--fv-2); } .fb-st.k-beruf { --c: var(--fv-1); } .fb-st.k-ausbildung { --c: var(--fv-4); } .fb-st.k-ereignis { --c: var(--fv-8); }
.fb-st-b { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--r-row); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
@media (hover: hover) { .fb-st-b:hover { background: color-mix(in srgb, var(--text) 5%, transparent); } }
.fb-st-when { display: flex; align-items: baseline; gap: var(--sp-2); font-family: var(--mono); font-size: var(--fs-micro); color: var(--faint); letter-spacing: .02em; }
.fb-st-when small { font-family: var(--ui); color: var(--c, var(--dim)); }
.fb-st-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; font-size: var(--fs-body); line-height: 1.35; }
.fb-st-main b { font-weight: 600; }
.fb-tag { display: inline-block; padding: 0 7px; border: 1px solid var(--line); border-radius: var(--r-chip); font-size: var(--fs-micro); line-height: 1.5; color: var(--dim); white-space: nowrap; font-weight: 400; }
.fb-tag.k-ca { color: var(--yel); border-color: color-mix(in srgb, var(--yel) 55%, var(--line)); }
.fb-st-text { font-size: var(--fs-sm); line-height: 1.45; color: var(--dim); }
.fb-st-img { display: block; max-width: 160px; max-height: 110px; border-radius: var(--r-row); object-fit: cover; margin-top: 4px; }
.fb-tl-empty { padding: var(--sp-3); border: 1px dashed var(--line); border-radius: var(--r-inner); font-size: var(--fs-sm); line-height: 1.45; color: var(--dim); }
.fb-tl-empty b { color: var(--text); font-weight: 500; }

/* Gehalt: dezent in der Zeile, Kurve als Stufen über die Berufsstationen */
.fb-gehalt { font-family: var(--mono); font-size: var(--fs-micro); color: var(--fv-1); white-space: nowrap; }
.fb-gehalt small { font-family: var(--ui); color: var(--faint); white-space: normal; }
.fb-sal { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-2) var(--sp-2) var(--sp-1); margin: 2px 0 6px; border: 1px solid var(--line); border-radius: var(--r-inner);
  background: radial-gradient(110% 80% at 20% 0%, color-mix(in oklab, var(--fv-1) 8%, var(--bg)) 0%, var(--bg) 60%), var(--bg); }
.fb-sal-h { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; font-size: var(--fs-meta); }
.fb-sal-svg { display: block; width: 100%; height: auto; overflow: visible; }
.fb-sal-line { fill: none; stroke: var(--fv-1); stroke-width: 1.8; stroke-linejoin: round; filter: drop-shadow(0 0 calc(6px * var(--fx-glow)) color-mix(in oklab, var(--fv-1) 50%, transparent)); }
.fb-sal-fill { fill: color-mix(in srgb, var(--fv-1) 12%, transparent); }
.fb-sal-dot { fill: var(--surf); stroke: var(--fv-1); stroke-width: 1.6; }
.fb-sal-x { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--faint); }

/* ---------- 5 · Dialoge ---------- */
.fb-dlg { display: flex; flex-direction: column; gap: var(--sp-3); }
.fb-form { display: flex; flex-direction: column; gap: var(--sp-3); }
.fb-form-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.fb-form-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
.fb-dlg .field small { font-size: var(--fs-micro); }
.fb-dlg textarea.in { resize: vertical; min-height: 60px; font-family: var(--ui); }
.fb-chk { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--dim); cursor: pointer; }
.fb-err { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-row); background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); font-size: var(--fs-sm); }
.fb-dlg-acts { flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); }
.fb-dlg-acts .faint { font-size: var(--fs-meta); }
.fb-foto-row { flex-wrap: wrap; gap: var(--sp-2); }
@media (max-width: 760px) { .fb-form-2, .fb-form-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- 6 · Familien-Zeitleiste ---------- */
.fb-zeit-p { gap: var(--sp-3); }
.fb-ftl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.fb-fy { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--sp-3); align-items: start; }
.fb-fy-y { font-family: var(--mono); font-size: var(--fs-lead); font-weight: 600; color: var(--acc); letter-spacing: -.02em; padding-top: 5px; text-align: right; }
.fb-fy-items { display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); padding-left: var(--sp-3); }
.fb-fe { display: grid; grid-template-columns: 18px auto minmax(0, 1fr); align-items: baseline; gap: var(--sp-2); width: 100%; min-height: var(--tap); padding: 5px 8px; border: 0; border-radius: var(--r-row); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.fb-fe i { font-style: normal; color: var(--c, var(--dim)); text-align: center; }
.fb-fe.k-geburt { --c: var(--fv-1); } .fb-fe.k-tod { --c: var(--faint); } .fb-fe.k-partnerschaft { --c: var(--fv-8); } .fb-fe.k-wohnort { --c: var(--fv-2); } .fb-fe.k-beruf { --c: var(--fv-1); } .fb-fe.k-ausbildung { --c: var(--fv-4); } .fb-fe.k-ereignis { --c: var(--fv-8); }
.fb-fe-d { font-family: var(--mono); font-size: var(--fs-meta); color: var(--dim); white-space: nowrap; }
.fb-fe-t { font-size: var(--fs-body); line-height: 1.35; overflow-wrap: anywhere; }
.fb-fe-t b { font-weight: 500; }
@media (hover: hover) { .fb-fe:hover { background: color-mix(in srgb, var(--text) 5%, transparent); } .fb-fe:hover .fb-fe-t b { color: var(--acc); } }
@media (max-width: 760px) { .fb-fy { grid-template-columns: 48px minmax(0, 1fr); gap: var(--sp-2); } .fb-fe { grid-template-columns: 18px minmax(0, 1fr); } .fb-fe-d { grid-column: 2; } .fb-fe-t { grid-column: 2; } }

/* ---------- 7 · Familienbuch (Bildschirm und Druck) ---------- */
.fb-buch { display: flex; flex-direction: column; gap: var(--sp-3); }
.fb-buch-bar { flex-wrap: wrap; gap: var(--sp-2); }
.fb-buch-bar .in { max-width: 260px; }
.fb-book { max-width: 820px; margin: 0 auto; width: 100%; padding: var(--sp-6) var(--sp-5); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surf); display: flex; flex-direction: column; gap: var(--sp-6); }
.fb-book-h h1 { margin: 4px 0 6px; font-size: 32px; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; }
.fb-chap { display: flex; flex-direction: column; gap: var(--sp-3); padding-top: var(--sp-5); border-top: 1px solid var(--line); break-inside: avoid-page; }
.fb-chap-h { display: flex; gap: var(--sp-4); align-items: center; }
.fb-chap-h h2 { margin: 0 0 2px; font-size: 22px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.fb-chap-h > div { display: flex; flex-direction: column; gap: 1px; font-size: var(--fs-sm); color: var(--dim); }
.fb-chap-rel { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--sp-3); margin: 0; font-size: var(--fs-sm); }
.fb-chap-rel dt { color: var(--faint); } .fb-chap-rel dd { margin: 0; color: var(--text); }
.fb-book-tl { list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; display: flex; flex-direction: column; gap: var(--sp-4); }
.fb-book-tl::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.fb-book-tl li { position: relative; break-inside: avoid; }
.fb-book-tl li::before { content: ''; position: absolute; left: -18px; top: 6px; width: 9px; height: 9px; border-radius: var(--r-full); background: var(--c, var(--dim)); }
.fb-book-tl .k-wohnort { --c: var(--fv-2); } .fb-book-tl .k-beruf { --c: var(--fv-1); } .fb-book-tl .k-ausbildung { --c: var(--fv-4); } .fb-book-tl .k-ereignis { --c: var(--fv-8); }
.fb-book-when { font-family: var(--mono); font-size: var(--fs-meta); color: var(--faint); }
.fb-book-when .k-ca { color: var(--yel); }
.fb-book-tl h3 { margin: 2px 0 4px; font-size: var(--fs-lead); font-weight: 600; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.fb-book-img { display: block; max-width: 100%; max-height: 320px; border-radius: var(--r-inner); margin: 4px 0 8px; }
.fb-book .fb-md { font-size: var(--fs-body); line-height: 1.6; color: var(--text); }
@media print {
  @page { margin: 18mm 16mm; }
  body, .app { height: auto; padding: 0; background: #fff; color: #111; }
  .nav, .fb-head, .fb-buch-bar, .toasts, .claude-dock, .ov-arr { display: none !important; }
  .main { overflow: visible; padding: 0; }
  .fb-page.fb-print .fb-body, .fb-page.fb-print .fb-zeit { display: none !important; }
  .fb-book { max-width: none; border: 0; background: #fff; color: #111; padding: 0; gap: 10mm; box-shadow: none; }
  .fb-book *, .fb-book .faint, .fb-book .fb-md { color: #111 !important; text-shadow: none !important; box-shadow: none !important; }
  .fb-book .faint, .fb-book-when, .fb-chap-rel dt { color: #555 !important; }
  .fb-chap { page-break-inside: avoid; border-top-color: #ccc; }
  .fb-book-tl::before, .fb-chap, .fb-book-h { border-color: #ccc; }
  .fb-book-tl li::before, .fb-av { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .fb-av { box-shadow: inset 0 0 0 1px #999; background: #eee; }
}

/* ---------- 8 · Handy: Detail als Blatt von unten, Bühne volle Breite ---------- */
@media (max-width: 1000px) { .fb-body { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (max-width: 760px) {
  .fb-body { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .fb-stage { min-height: min(62vh, 560px); }
  .fb-cap { display: none; }
  .fb-head .btn.acc { padding: 6px 10px; }
  .fb-sheet { display: none; }
  .panel.fb-sheet.open { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; /* unter Dialogen (.overlay 100), sonst verdeckt das Blatt den Bearbeiten-Dialog */ max-height: 64vh; max-height: 64dvh; overflow-y: auto;
    border-radius: var(--sheet-r, 14px) var(--sheet-r, 14px) 0 0; border-bottom: 0; padding: 0 var(--sp-4) calc(var(--sp-4) + env(safe-area-inset-bottom)); background: var(--surf);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, .45); animation: sheet 180ms ease-out; }
  .panel.fb-sheet h3 { position: sticky; top: 0; z-index: 1; margin: 0; padding: 18px 0 8px; background: var(--surf); }
  .fb-sheet h3::before { content: ''; position: absolute; left: 50%; top: 6px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--faint); opacity: .6; }
  .fb-sheet .fb-x { min-width: 44px; min-height: 36px; font-size: 20px; color: var(--text); border-color: var(--line); }
  .fb-sheet-bg { z-index: 89; background: rgba(0, 0, 0, .3); }
  .fb-sheet-bg.hidden { display: none; }
  /* ohne Auswahl ist das Blatt zu: die Übersicht der Familie gibt es dann nur über die Bühne */
}
@media (prefers-reduced-motion: reduce) { :root:not([data-motion="an"]) .panel.fb-sheet.open { animation: none; } }

/* Person auf Person ziehen: Etikett folgt dem Zeiger, Ziel leuchtet */
.fb-dragmode, .fb-dragmode .fb-node { cursor: grabbing; }
.fb-node.fb-dragging { opacity: .45; }
.fb-node.fb-drop .fb-halo { opacity: .3; }
.fb-node.fb-drop .fb-ring { stroke: var(--acc); stroke-width: 3; opacity: 1; }
.fb-dragghost { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; padding: 4px 10px; border-radius: 999px; background: var(--acc); color: var(--on-acc); font-size: 13px; white-space: nowrap; box-shadow: 0 4px 14px rgb(0 0 0 / .3); }
.fb-drop-opts { display: grid; gap: 8px; }
.fb-drop-opts .btn { justify-content: flex-start; text-align: left; white-space: normal; height: auto; min-height: 36px; line-height: 1.3; padding-block: 8px; overflow-wrap: anywhere; }
.fb-drop-status { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.fb-drop-status .in { width: auto; min-width: 150px; }

/* Namen bleiben lesbar, wenn eine Linie unter ihnen kreuzt: Rand in Hintergrundfarbe */
.fb-l1, .fb-l2, .fb-l3, .fb-gl { paint-order: stroke fill; stroke: var(--page); stroke-width: 4px; stroke-linejoin: round; }
