/* === FONTES GENEALOGIE: TOP-RIGHT TOGGLE & 2 ZUSÄTZLICHE MUSTERLAYOUTS === */
.gen-header {
  position: sticky;
  top: 0;
  z-index: 45;
}
.gen-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}
.gen-header-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem 0.9rem;
  margin-left: auto;
}
.gen-layout-switch {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
}
.gen-layout-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.34rem 0.62rem;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  opacity: 0.74;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.gen-layout-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.55);
}
.gen-layout-btn.is-active {
  opacity: 1;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}
.gen-layout-ico {
  font-size: 0.86rem;
  line-height: 1;
}

/* Container-Umschaltung auf /gen/stammbaum/... */
#gen-alt-stage { display: none; }
html[data-gen-layout="matriken"] .gen-has-alt #gen-default-cards,
html[data-gen-layout="stammtafel"] .gen-has-alt #gen-default-cards {
  display: none !important;
}
html[data-gen-layout="matriken"] .gen-has-alt #gen-alt-stage,
html[data-gen-layout="stammtafel"] .gen-has-alt #gen-alt-stage {
  display: block;
}

/* Gemeinsame Werkzeugleiste für Musterlayout 2 & 3 */
.gen-stage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin: 0.85rem 0 1rem;
  padding: 0.7rem 0.95rem;
  border-radius: 8px;
}
.gen-stage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.gen-tab-chip {
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: rgba(255, 255, 255, 0.7);
  color: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
}
.gen-tab-chip.is-active {
  background: #1e293b;
  color: #fff;
  border-color: #1e293b;
}
.gen-stage-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.gen-stage-filter input {
  padding: 0.36rem 0.68rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  font-size: 0.83rem;
  min-width: 220px;
  background: #fff;
}

/* ==========================================================================
   MUSTERLAYOUT 2: MATRIKENBUCH (Archiv-Register / Tiroler Pfarrmatrikel)
   ========================================================================== */
html[data-gen-layout="matriken"] body.gen-body {
  background: #f4efe4;
  color: #231c15;
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
}
html[data-gen-layout="matriken"] .gen-header {
  background: #ebe3d1;
  border-bottom: 3px double #8c785c;
}
html[data-gen-layout="matriken"] .gen-brand-kicker {
  color: #7f1d1d !important;
  letter-spacing: 0.09em;
}
html[data-gen-layout="matriken"] .gen-brand-title {
  font-family: Georgia, serif;
  color: #1f1812;
}
html[data-gen-layout="matriken"] .gen-layout-btn.is-active {
  background: #7f1d1d;
  color: #fdfaf3;
}
html[data-gen-layout="matriken"] .gen-container {
  max-width: 1260px;
}
html[data-gen-layout="matriken"] .gen-card {
  background: #fbf8f1;
  border: 1px solid #cbbba0;
  border-top: 3px double #8c785c;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(35, 28, 21, 0.05);
}
html[data-gen-layout="matriken"] .gen-stage-toolbar {
  background: #ece4d3;
  border: 1px solid #c5b496;
  border-radius: 2px;
}
html[data-gen-layout="matriken"] .gen-tab-chip.is-active {
  background: #7f1d1d;
  border-color: #7f1d1d;
  color: #fff;
}
.matriken-ledger-wrap {
  background: #fbf8f1;
  border: 1px solid #c5b496;
  border-top: 3px double #7f1d1d;
  overflow-x: auto;
}
.matriken-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
.matriken-table thead th {
  background: #efe7d6;
  color: #523d28;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-align: left;
  padding: 0.58rem 0.7rem;
  border-bottom: 2px solid #b5a182;
  white-space: nowrap;
}
.matriken-table tbody tr.matriken-row {
  border-bottom: 1px solid #e3dac8;
  transition: background 0.12s ease;
}
.matriken-table tbody tr.matriken-row:hover {
  background: #f3ecdc;
}
.matriken-table td {
  padding: 0.52rem 0.7rem;
  vertical-align: top;
}
.matriken-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.77rem;
  font-weight: 700;
  color: #7f1d1d;
  white-space: nowrap;
}
.matriken-date {
  white-space: nowrap;
  color: #3d3124;
  font-size: 0.83rem;
}
.matriken-place {
  display: block;
  font-size: 0.77rem;
  color: #6b5842;
  font-style: italic;
}
.matriken-person a {
  color: #1f1812;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dotted #8c785c;
}
.matriken-person a:hover {
  color: #7f1d1d;
  border-bottom-style: solid;
}
.matriken-vital {
  display: block;
  font-size: 0.77rem;
  color: #5c4b37;
  margin-top: 0.1rem;
}
.matriken-kids-btn {
  border: 1px solid #bfa987;
  background: #f2ead9;
  color: #3b2d1f;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.52rem;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
}
.matriken-kids-btn:hover {
  background: #e6dac2;
}
.matriken-drawer {
  background: #f5efe2;
  border-bottom: 2px solid #d1c2a8;
}
.matriken-kids-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 0.38rem 0.9rem;
  padding: 0.55rem 0.85rem 0.7rem 2.2rem;
}
.matriken-kid-item {
  font-size: 0.82rem;
  padding: 0.22rem 0;
  border-bottom: 1px dashed #dcd0ba;
}
.matriken-jump {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.38rem;
  font-size: 0.71rem;
  background: #7f1d1d;
  color: #fff !important;
  border-radius: 3px;
  text-decoration: none !important;
  cursor: pointer;
}
.matriken-pdf {
  font-size: 0.76rem;
  color: #7f1d1d;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid #cbb396;
  padding: 0.18rem 0.45rem;
  background: #fffdf9;
  white-space: nowrap;
}
/* Auch Nachnamen- & Startseite in Matriken-Optik verdichten */
html[data-gen-layout="matriken"] .gen-grid-2 {
  gap: 0.65rem;
}
html[data-gen-layout="matriken"] .gen-pill {
  background: #efe7d6;
  border: 1px solid #c5b496;
  border-radius: 2px;
  color: #2b2118;
}

/* ==========================================================================
   MUSTERLAYOUT 3: STAMMTAFEL (Generationen- & Linienbaum mit Ast-Aufklappung)
   ========================================================================== */
html[data-gen-layout="stammtafel"] body.gen-body {
  background: #eef2f6;
  color: #0f172a;
}
html[data-gen-layout="stammtafel"] .gen-header {
  background: #0f2942;
  color: #f8fafc;
  border-bottom: 2px solid #c2812d;
}
html[data-gen-layout="stammtafel"] .gen-brand,
html[data-gen-layout="stammtafel"] .gen-brand-title {
  color: #f8fafc !important;
}
html[data-gen-layout="stammtafel"] .gen-brand-kicker {
  color: #eab308 !important;
}
html[data-gen-layout="stammtafel"] .gen-layout-switch {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}
html[data-gen-layout="stammtafel"] .gen-layout-btn {
  color: #e2e8f0;
}
html[data-gen-layout="stammtafel"] .gen-layout-btn.is-active {
  background: #eab308;
  color: #0f172a;
}
html[data-gen-layout="stammtafel"] .gen-container {
  max-width: 1320px;
}
html[data-gen-layout="stammtafel"] .gen-card {
  border-left: 4px solid #0f2942;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(15, 41, 66, 0.06);
}
.stamm-layout-grid {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  margin-top: 0.9rem;
}
@media (max-width: 920px) {
  .stamm-layout-grid { grid-template-columns: 1fr; }
}
.stamm-sidebar {
  position: sticky;
  top: 4.8rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: 3px solid #0f2942;
  border-radius: 10px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.stamm-side-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
}
.stamm-mode-list, .stamm-century-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.stamm-nav-btn {
  text-align: left;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #1e293b;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stamm-nav-btn.is-active {
  background: #0f2942;
  color: #fff;
  border-color: #0f2942;
}
.stamm-stream {
  position: relative;
  padding-left: 1.35rem;
  border-left: 3px solid #cbd5e1;
}
.stamm-century-banner {
  position: relative;
  margin: 1.3rem 0 0.75rem;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0f2942;
}
.stamm-century-banner::before {
  content: "";
  position: absolute;
  left: -1.78rem;
  top: 0.22rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #c2812d;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #c2812d;
}
.stamm-node {
  position: relative;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.9rem 1.05rem;
  margin-bottom: 0.95rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.stamm-node.is-highlighted {
  border-color: #c2812d;
  box-shadow: 0 0 0 3px rgba(194, 129, 45, 0.28);
}
.stamm-node-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid #f1f5f9;
}
.stamm-code-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  background: #0f2942;
  color: #fff;
  padding: 0.16rem 0.5rem;
  border-radius: 5px;
}
.stamm-couple-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.55rem;
  align-items: stretch;
}
@media (max-width: 680px) {
  .stamm-couple-row { grid-template-columns: 1fr; }
}
.stamm-partner-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-top: 3px solid #0f2942;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}
.stamm-partner-box.is-female {
  border-top-color: #b45309;
}
.stamm-partner-box a.stamm-pname {
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  font-size: 0.95rem;
}
.stamm-partner-box a.stamm-pname:hover {
  color: #b45309;
  text-decoration: underline;
}
.stamm-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  color: #64748b;
  padding: 0 0.25rem;
  text-align: center;
}
.stamm-parent-chip {
  display: inline-block;
  margin-top: 0.28rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #0f2942;
  background: #e2e8f0;
  padding: 0.1rem 0.42rem;
  border-radius: 4px;
  cursor: pointer;
  border: 0;
}
.stamm-children-stem {
  position: relative;
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 2px solid #cbd5e1;
}
.stamm-children-stem::before {
  content: "";
  position: absolute;
  top: -0.78rem;
  left: 50%;
  width: 2px;
  height: 0.78rem;
  background: #94a3b8;
}
.stamm-kids-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 0.5rem;
}
.stamm-kid-card {
  background: #ffffff;
  border: 1px solid #dbe3ec;
  border-left: 3px solid #64748b;
  border-radius: 6px;
  padding: 0.42rem 0.58rem;
  font-size: 0.82rem;
}
.stamm-kid-card.has-branch {
  border-left-color: #c2812d;
  background: #fffbeb;
}
.stamm-branch-btn {
  margin-top: 0.32rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #c2812d;
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 0.18rem 0.48rem;
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
}
.stamm-branch-btn:hover {
  background: #9a631d;
}
.stamm-subbranch {
  margin-top: 0.65rem;
  margin-left: 0.85rem;
  padding-left: 0.85rem;
  border-left: 2px dashed #c2812d;
}
