@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap');

:root {
  /* Heritage-Palette: Waldgruen + warmes Holzbraun + Creme */
  --green: #3a7d44;
  --green-dark: #2b5d33;
  --green-light: #e9f2ea;
  --wood: #8a5a3b;
  --wood-dark: #6f4529;
  --accent: #c08a2d;        /* warmes Gold fuer Akzente/CTA-Hervorhebung */
  --male: #4a7fb0;
  --female: #c56b96;
  --other: #8a7bc0;
  --bg: #faf7f2;            /* warmes Creme statt kaltem Grau */
  --card: #ffffff;
  --text: #2a241f;
  --muted: #7a7067;
  --border: #e6ddd0;
  --danger: #b4442f;
  --shadow: 0 2px 10px rgba(60, 45, 30, 0.08);
  --shadow-lg: 0 10px 30px rgba(60, 45, 30, 0.12);
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, .brand { font-family: var(--font-heading); letter-spacing: 0.2px; }

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  height: 60px;
  background: linear-gradient(100deg, var(--green-dark) 0%, var(--green) 60%, var(--wood) 140%);
  color: #fff;
  box-shadow: var(--shadow);
}
.brand { color: #fff; text-decoration: none; font-weight: 600; font-size: 20px; display: flex; align-items: center; }
.brand-logo { height: 38px; width: auto; display: block; }
.topbar-nav { display: flex; align-items: center; gap: 14px; }
.user-badge { font-size: 14px; opacity: 0.85; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}
.btn:hover { background: var(--green-light); border-color: #cfe0d2; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 2px 6px rgba(58,125,68,0.25); }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
/* Abgestuftes Gruen fuer sekundaere Aktionen aus derselben Palette */
.btn-secondary-green { background: var(--green-light); border-color: var(--green); color: var(--green-dark); }
.btn-secondary-green:hover { background: #dcebdd; border-color: var(--green-dark); color: var(--green-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.93); }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,0.5); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,0.18); }
.btn-block { width: 100%; justify-content: center; margin-top: 12px; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Auth */
.content { padding: 24px; }
.auth-card {
  max-width: 380px;
  margin: 8vh auto;
  background: var(--card);
  padding: 32px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.auth-card h1 { margin: 0 0 20px; color: var(--green-dark); font-size: 28px; }
.auth-card label { display: block; margin: 12px 0 4px; font-size: 14px; font-weight: 600; }
.auth-card input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-card input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(58,125,68,0.15); }
.auth-switch { margin-top: 16px; font-size: 14px; text-align: center; }
.auth-switch a, a { color: var(--green); }
.alert { padding: 11px 14px; border-radius: var(--radius); font-size: 14px; margin-bottom: 12px; }
.alert-error { background: #fbe9e5; color: var(--danger); }
.alert-info { background: var(--green-light); color: var(--green-dark); }
.muted { color: var(--muted); }

/* Tree layout */
.tree-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  height: calc(100vh - 60px);
}
.content:has(.tree-layout) { padding: 0; }

/* Sidebar */
.sidebar {
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-header { display: flex; align-items: center; justify-content: space-between; }
.sidebar-header h2 { margin: 0; font-size: 16px; }
.search-input {
  width: 100%;
  margin: 12px 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.people-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.person-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: grab;
  background: #fff;
}
.person-chip:active { cursor: grabbing; }
.person-chip.in-tree { opacity: 0.5; }
.person-chip .avatar { flex: 0 0 32px; }
.sidebar-hint { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* Avatar */
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  overflow: hidden;
  border: 2px solid var(--border);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.male { border-color: var(--male); }
.avatar.female { border-color: var(--female); }
.avatar.other { border-color: var(--other); }

/* Baum-Arbeitsflaeche */
.tree-wrap {
  position: relative; overflow: auto;
  background: radial-gradient(circle, #e3ebe6 1px, transparent 1px);
  background-size: 22px 22px;
}
.tree-scroll { min-width: max-content; padding: 40px; }
.tree-root {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 40px;
  min-width: 100%;
}

/* Ein Paar-Knoten samt seiner Kinder */
.couple-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Die Paar-Box mit zwei Slots */
.couple-box {
  position: relative;   /* Anker fuer "+ Geschwister" am letzten Kind */
  display: flex;
  gap: 6px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: var(--shadow);
}

/* Slot (ein Platz fuer eine Person) */
.slot {
  width: 130px;
  min-height: 64px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.slot.empty {
  border: 2px dashed var(--border);
  background: #fafbfa;
  align-items: center;
  color: var(--muted);
  cursor: copy;
}
.slot.empty.optional { opacity: 0.55; }
.slot.empty .slot-hint { font-size: 12px; }
.slot.empty.drag-over { border-color: var(--green); background: var(--green-light); color: var(--green-dark); }
.slot.filled {
  border: 2px solid var(--border);
  background: #fff;
  padding: 8px;
}
.slot.filled.male { border-top: 4px solid var(--male); }
.slot.filled.female { border-top: 4px solid var(--female); }
.slot.filled.other { border-top: 4px solid var(--other); }
.slot-head { display: flex; align-items: center; gap: 8px; }
.slot-name { font-weight: 700; font-size: 13px; line-height: 1.2; }
.slot-dates { font-size: 11px; color: var(--muted); margin-top: 5px; }
.slot-remove {
  position: absolute; top: -8px; right: -8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--danger); color: #fff; border: none;
  font-size: 12px; cursor: pointer; display: none; z-index: 2;
}
.slot.filled:hover .slot-remove { display: block; }

/* Aktionsleiste unter einem Paar */
.couple-actions {
  display: flex; gap: 6px; margin-top: 6px;
  min-height: 26px; align-items: center;
}
.plus-btn {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--green); background: #fff; color: var(--green);
  font-size: 15px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.plus-btn:hover { background: var(--green); color: #fff; }
.plus-btn.couple-del { border-color: var(--danger); color: var(--danger); }
.plus-btn.couple-del:hover { background: var(--danger); color: #fff; }

/* Kinder-Reihe mit Verbindungslinien.
   Aufbau: Stamm vom Elternpaar nach unten -> horizontale Linie ueber den
   Kindern -> je ein Abzweig hoch zu jedem Kind. */
.children-row {
  --conn: 14px;        /* Hoehe von Stamm und Abzweigen */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 32px;
  margin-top: 0;
  position: relative;
  padding-top: calc(var(--conn) * 2);  /* Stamm + horizontale Linie + Abzweig */
}

/* 1) Stamm: vertikale Linie vom Elternpaar nach unten bis zur horizontalen Linie.
   Laeuft von y=0 bis y=var(--conn). --stem-x (per JS) legt die horizontale
   Position fest; Fallback: Mitte der Reihe. */
.children-row::before {
  content: "";
  position: absolute;
  top: 0; left: var(--stem-x, 50%);
  width: 2px; height: var(--conn);
  background: var(--green);
  transform: translateX(-50%);
  z-index: 0;
}

/* 2) Durchgehende horizontale Linie auf Hoehe y=var(--conn).
   Spannt zwischen der Mitte des ersten und letzten Kindes (per JS gesetzte
   Variablen --conn-left / --conn-right); Fallback: inset 50% (unsichtbar,
   bis JS misst). */
.children-row::after {
  content: "";
  position: absolute;
  top: var(--conn); height: 2px;
  left: var(--conn-left, 50%);
  right: var(--conn-right, 50%);
  background: var(--green);
  z-index: 0;
}

/* 3) Abzweig: vertikale Linie von der horizontalen Linie (y=var(--conn))
   hoch zu jedem Kind. Nur echte Kind-Knoten, NICHT "+ Geschwister". */
.children-row > .couple-node::before {
  content: "";
  position: absolute;
  top: calc(var(--conn) * -1); left: 50%;
  width: 2px; height: var(--conn);
  background: var(--green);
  transform: translateX(-50%);
  z-index: 0;
}

/* Einzelkind: keine horizontale Linie noetig (nur gerader Stamm). */
.children-row.single-child::after { display: none; }

/* "+ Geschwister" klebt kompakt rechts an der Box des letzten Kindes.
   Absolut im letzten .couple-node positioniert -> driftet nicht mit der
   Reihenbreite und beeinflusst Zentrierung/Linien-Messung nicht. */
.sibling-add {
  position: absolute;
  top: 50%;
  left: 100%;                /* direkt rechts an der Box des letzten Kindes */
  margin-left: 10px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  z-index: 1;
}

.add-root-btn {
  align-self: center;
  border: 2px dashed var(--green);
  background: var(--green-light);
  color: var(--green-dark);
  border-radius: 10px;
  padding: 18px 22px;
  font-size: 14px;
  cursor: pointer;
}
.add-root-btn:hover { background: #dcebe1; }

.sidebar-empty { padding: 8px; font-size: 13px; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 12px; padding: 24px;
  width: 440px; max-width: 92vw; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.modal h2 { margin: 0 0 16px; color: var(--green-dark); }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 9px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.modal-actions .spacer { flex: 1; }

/* Navigation-Links */
.nav-link { color: #fff; text-decoration: none; font-size: 14px; opacity: 0.92; }
.nav-link:hover { opacity: 1; text-decoration: underline; }

/* Zugangs-Banner (Trial / abgelaufen) */
.access-banner {
  padding: 10px 18px; font-size: 14px; text-align: center;
}
.access-banner a { font-weight: 600; }
.access-banner.trial { background: #fff6e5; color: #8a5a00; border-bottom: 1px solid #f0d9a8; }
.access-banner.trial a { color: #8a5a00; }
.access-banner.expired { background: #fdecea; color: var(--danger); border-bottom: 1px solid #f3c0ba; }
.access-banner.expired a { color: var(--danger); }

/* Upgrade-Seite */
.upgrade-card {
  max-width: 520px; margin: 6vh auto; background: var(--card);
  padding: 32px; border-radius: 12px; box-shadow: var(--shadow);
}
.upgrade-card h1 { margin: 0 0 12px; color: var(--green-dark); }
.upgrade-card .lead { color: var(--text); line-height: 1.5; }
.feature-list { margin: 16px 0; padding-left: 20px; }
.feature-list li { margin: 6px 0; }
.price-box { text-align: center; margin: 20px 0; }
.price-box .price { font-size: 42px; font-weight: 800; color: var(--green-dark); }
.price-box .per { color: var(--muted); font-size: 16px; }
.back-link { text-align: center; margin-top: 18px; }

/* Admin-Bereich */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 24px; }
.admin-wrap h1 { color: var(--green-dark); }
.admin-totals { display: flex; gap: 16px; margin: 16px 0 24px; flex-wrap: wrap; }
.admin-totals .stat {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 18px; box-shadow: var(--shadow); font-size: 14px; color: var(--muted);
}
.admin-totals .num { font-size: 24px; font-weight: 800; color: var(--green-dark); display: block; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.admin-table th { background: var(--green-light); color: var(--green-dark); }
.admin-table tr.inactive-row { opacity: 0.55; }
.admin-table .actions { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-table .actions form { margin: 0; }
.tag { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.tag-admin { background: #e6e0f7; color: #5b3fb0; margin-left: 6px; }
.tag-ok { background: #e3f3e8; color: #1f7a44; }
.tag-wait { background: #fff3d6; color: #8a6400; }
.tag-off { background: #fde2de; color: #b02a1a; }
.tag-paid { background: #d9f0e4; color: #137a46; }
.tag-trial { background: #fff0d0; color: #8a5a00; }
.tag-exp { background: #fde2de; color: #b02a1a; }

/* Profil */
.profile-wrap { max-width: 560px; margin: 0 auto; padding: 24px; }
.profile-wrap h1 { color: var(--green-dark); }
.profile-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.profile-card h2 { margin: 0 0 12px; font-size: 16px; color: var(--green-dark); }
.profile-card .form-row label { display: block; font-size: 13px; font-weight: 600; margin: 8px 0 4px; }
.profile-card .form-row input { width: 100%; padding: 9px; border: 1px solid var(--border); border-radius: 8px; }
.profile-card.danger-zone { border-color: #f3c0ba; }
.profile-card.danger-zone h2 { color: var(--danger); }

/* Baum-Uebersicht */
.trees-wrap { max-width: 900px; margin: 0 auto; padding: 24px; }
.trees-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.trees-head h1 { color: var(--green-dark); margin: 0; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; }
.inline-form input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.tree-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 20px; }
.tree-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.tree-card-main { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px; text-decoration: none; color: var(--text); }
.tree-card-main:hover { background: var(--green-light); }
.tree-icon { font-size: 28px; }
.tree-name { font-weight: 700; font-size: 16px; color: var(--green-dark); }
.tree-meta { font-size: 12px; color: var(--muted); }
.tree-card-actions { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--border); background: #fafbfa; }
.tree-card-actions .inline-form input { width: 100%; font-size: 13px; }
.tree-title { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.tree-title a { color: var(--green); text-decoration: none; }

/* Plan-Auswahl (monatlich / jaehrlich) */
.plan-choice { display: flex; gap: 14px; margin: 20px 0; flex-wrap: wrap; }
.plan-box {
  flex: 1; min-width: 160px; text-align: center;
  border: 2px solid var(--border); border-radius: 12px; padding: 16px;
  background: #fff;
}
.plan-box.highlight { border-color: var(--green); background: var(--green-light); }
.plan-head { font-weight: 700; color: var(--green-dark); margin-bottom: 8px; }
.plan-head .save {
  display: inline-block; margin-left: 4px; font-size: 11px; font-weight: 600;
  background: var(--green); color: #fff; border-radius: 10px; padding: 1px 7px;
}
.plan-box .price { font-size: 32px; font-weight: 800; color: var(--green-dark); }
.plan-box .per { color: var(--muted); font-size: 14px; }
.paypal-blocks { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.paypal-col { flex: 1; min-width: 180px; }
.paypal-label { font-size: 13px; font-weight: 600; margin: 0 0 8px; text-align: center; }

/* Rechtsseiten */
.legal-wrap { max-width: 760px; margin: 0 auto; padding: 28px 24px; line-height: 1.6; }
.legal-wrap h1 { color: var(--green-dark); }
.legal-wrap h2 { font-size: 16px; color: var(--green-dark); margin: 22px 0 6px; }
.legal-wrap ul { padding-left: 20px; }
.legal-wrap hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.widerruf-form { border: 1px solid var(--border); border-radius: 10px; padding: 16px; background: #fafbfa; font-size: 14px; }
.widerruf-form p { margin: 6px 0; }

/* Footer */
.site-footer {
  margin-top: 40px; padding: 18px; text-align: center;
  font-size: 13px; color: var(--muted); border-top: 1px solid var(--border);
  background: var(--card);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--green); text-decoration: underline; }
.site-footer .sep { margin: 0 6px; opacity: 0.5; }

/* Einzelperson: kompakter "+ Partner"-Button statt leerem zweiten Feld */
.add-partner-btn {
  align-self: stretch;
  border: 2px dashed var(--border);
  background: #fafbfa;
  color: var(--muted);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.add-partner-btn:hover { border-color: var(--green); color: var(--green-dark); background: var(--green-light); }

/* Einklapp-Button am leeren Partner-Feld */
.slot .slot-collapse {
  position: absolute; top: -8px; right: -8px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--muted); color: #fff; border: none;
  font-size: 11px; line-height: 1; cursor: pointer;
}
.slot .slot-collapse:hover { background: var(--danger); }

/* PDF-Export in der Baum-Sidebar */
.export-btn {
  margin: 2px 0 10px; width: 100%; justify-content: center;
  background: var(--wood); border-color: var(--wood); color: #fff;
}
.export-btn:hover { background: var(--wood-dark); border-color: var(--wood-dark); }
.export-hint {
  display: block; margin: 2px 0 10px; padding: 7px 10px;
  font-size: 12px; text-align: center; color: var(--muted);
  background: var(--muted-bg, #f3ede3); border: 1px dashed var(--border);
  border-radius: var(--radius); text-decoration: none;
}
.export-hint:hover { color: var(--wood-dark); border-color: var(--wood); }

/* ── Onboarding-Tour (Shepherd.js) im Heritage-Look ─────────────────────── */
.shepherd-element.deinstammbaum-shepherd {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 25rem;
  font-family: var(--font-body);
}
.deinstammbaum-shepherd .shepherd-header {
  background: linear-gradient(100deg, var(--green-dark) 0%, var(--green) 70%);
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  padding: 14px 16px;
}
.deinstammbaum-shepherd .shepherd-title {
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
}
.deinstammbaum-shepherd .shepherd-cancel-icon {
  color: rgba(255, 255, 255, 0.85);
}
.deinstammbaum-shepherd .shepherd-cancel-icon:hover {
  color: #fff;
}
.deinstammbaum-shepherd .shepherd-text {
  padding: 16px;
  color: var(--text);
  line-height: 1.55;
  font-size: 14px;
}
.deinstammbaum-shepherd .shepherd-footer {
  padding: 0 16px 16px;
  gap: 8px;
}
.deinstammbaum-shepherd .shepherd-button {
  background: var(--green);
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  padding: 8px 16px;
}
.deinstammbaum-shepherd .shepherd-button:not(:disabled):hover {
  background: var(--green-dark);
  color: #fff;
}
.deinstammbaum-shepherd .shepherd-button.shepherd-button-secondary {
  background: var(--green-light);
  color: var(--green-dark);
}
.deinstammbaum-shepherd .shepherd-button.shepherd-button-secondary:not(:disabled):hover {
  background: #d8e8da;
  color: var(--green-dark);
}

/* ── Beziehungsstatus-Symbol zwischen den Partnern ──────────────────────── */
.rel-status-wrap {
  align-self: center;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.rel-status-date {
  font-size: 10px;
  font-weight: 600;
  color: var(--wood-dark);
  white-space: nowrap;
  line-height: 1;
}
.rel-status {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--wood-dark);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: var(--shadow);
  transition: transform 0.1s ease, border-color 0.1s ease;
}
.rel-status:hover { transform: scale(1.12); border-color: var(--green); }
.rel-status.rel-verheiratet { border-color: var(--accent); }
.rel-status.rel-geschieden  { border-color: var(--danger); }

/* Mini-Menue zur Status-Auswahl */
.rel-menu {
  position: absolute;
  transform: translateX(-50%);
  z-index: 50;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 160px;
}
.rel-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.rel-menu-item:hover { background: var(--green-light); }
.rel-menu-item.active { background: var(--green-light); font-weight: 700; color: var(--green-dark); }
.rel-menu-icon { font-size: 15px; width: 18px; text-align: center; }
.rel-menu-date {
  margin-top: 6px;
  padding: 7px 10px 2px;
  border-top: 1px solid var(--border);
}
.rel-menu-date label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.rel-menu-date input[type="date"] {
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
}
.rel-menu-save {
  margin-top: 8px;
  width: 100%;
  border: none;
  background: var(--green);
  color: #fff;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.rel-menu-save:hover { background: var(--green-dark); }

/* ── PDF-Export-Auswahl (3 Modi) ────────────────────────────────────────── */
.export-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 4px 0 10px;
}
.export-group .export-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--green-dark);
  margin-right: 2px;
}
.export-group .export-btn {
  padding: 4px 10px;
  font-size: 12px;
}

/* ══════════════ Landingpage (Startseite) ══════════════ */
.btn-lg { padding: 13px 26px; font-size: 16px; }

/* Hero */
.lp-hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 55%, var(--wood) 130%);
  color: #fff;
  margin: -24px -24px 0;      /* randlos ueber die content-Breite */
  padding: 72px 24px 80px;
  text-align: center;
}
.lp-hero-inner { max-width: 760px; margin: 0 auto; }
.lp-hero-logo {
  height: 110px; width: auto; display: block; margin: 0 auto 20px;
}
.lp-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.12;
  margin: 0 0 18px;
  color: #fff;
}
.lp-hero-sub {
  font-size: 18px;
  line-height: 1.6;
  color: rgba(255,255,255,0.92);
  margin: 0 auto 28px;
  max-width: 620px;
}
.lp-hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.lp-hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.6); }
.lp-hero .btn-ghost:hover { background: rgba(255,255,255,0.14); border-color: #fff; }
.lp-hero-note { margin-top: 16px; font-size: 13px; color: rgba(255,255,255,0.8); }

/* Sections */
.lp-section { max-width: 1000px; margin: 0 auto; padding: 56px 8px; }
.lp-section-alt {
  max-width: none;
  background: var(--green-light);
  margin: 0 -24px;
  padding: 56px 24px;
}
.lp-section-alt > * { max-width: 1000px; margin-left: auto; margin-right: auto; }
.lp-h2 {
  font-family: var(--font-heading);
  font-size: clamp(24px, 3.5vw, 34px);
  color: var(--green-dark);
  text-align: center;
  margin: 0 0 36px;
}

/* Features */
.lp-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.lp-feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  text-align: center;
}
.lp-feature-icon { font-size: 40px; line-height: 1; margin-bottom: 14px; }
.lp-feature h3 { font-family: var(--font-heading); color: var(--green-dark); margin: 0 0 10px; font-size: 20px; }
.lp-feature p { color: var(--muted); line-height: 1.6; margin: 0; font-size: 15px; }

/* Steps */
.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.lp-step { text-align: center; padding: 8px; }
.lp-step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--green); color: #fff;
  font-family: var(--font-heading); font-size: 20px; font-weight: 700;
  margin-bottom: 14px;
}
.lp-step h3 { font-family: var(--font-heading); color: var(--green-dark); margin: 0 0 8px; font-size: 19px; }
.lp-step p { color: var(--muted); line-height: 1.6; margin: 0; font-size: 15px; }

/* Pricing */
.lp-pricing-intro { text-align: center; color: var(--muted); max-width: 620px; margin: -20px auto 32px; line-height: 1.6; }
.lp-pricing { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.lp-price-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow);
  width: 280px;
  text-align: center;
}
.lp-price-card-featured { border: 2px solid var(--green); box-shadow: var(--shadow-lg); }
.lp-price-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  padding: 4px 12px; border-radius: 999px; white-space: nowrap;
}
.lp-price-card h3 { font-family: var(--font-heading); color: var(--green-dark); margin: 4px 0 12px; font-size: 20px; }
.lp-price { margin-bottom: 10px; }
.lp-price-num { font-size: 40px; font-weight: 800; color: var(--green-dark); }
.lp-price-per { color: var(--muted); font-size: 15px; margin-left: 4px; }
.lp-price-desc { color: var(--muted); font-size: 14px; margin: 0 0 18px; min-height: 38px; }
.lp-price-features {
  list-style: none; padding: 0; margin: 0 auto; max-width: 520px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px;
}
.lp-price-features li { position: relative; padding-left: 24px; color: var(--text); font-size: 14px; line-height: 1.5; }
.lp-price-features li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--green); font-weight: 700;
}

/* Abschluss-CTA */
.lp-cta {
  text-align: center;
  background: var(--green-light);
  margin: 40px -24px -24px;
  padding: 56px 24px 64px;
}
.lp-cta h2 { font-family: var(--font-heading); color: var(--green-dark); font-size: clamp(24px, 3.5vw, 32px); margin: 0 0 10px; }
.lp-cta p { color: var(--muted); margin: 0 0 24px; font-size: 16px; }

/* Responsive */
@media (max-width: 760px) {
  .lp-features, .lp-steps { grid-template-columns: 1fr; }
  .lp-price-features { grid-template-columns: 1fr; }
}

/* ── Foto-Upload im Personen-Formular ───────────────────────────────────── */
.photo-upload { display: flex; align-items: center; gap: 12px; }
.photo-preview {
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--border); background: #fff;
  flex: 0 0 64px;
}
.photo-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--muted); text-align: center;
  background: var(--green-light); border-style: dashed;
}
.photo-upload-actions { display: flex; flex-direction: column; gap: 6px; }

/* ══════════════ Dezente Verzierungen (Heritage-Ornamente) ══════════════ */

/* Ornamentaler Sektionstrenner: feine Linie mit zentralem Zweig/Blatt-Motiv.
   Als eigenstaendiges Element <div class="ornament-divider"></div> einsetzbar. */
.ornament-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 8px auto 0;
  max-width: 420px;
  color: var(--accent);
}
.ornament-divider::before,
.ornament-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(to var(--_dir, right),
    transparent, color-mix(in srgb, var(--accent) 55%, transparent));
}
.ornament-divider::before { --_dir: left; }
.ornament-divider .ornament-mark {
  width: 30px; height: 30px; flex: 0 0 30px;
  color: var(--accent);
}
/* Blatt-/Zweig-Ornament (SVG inline per currentColor einfaerbbar). */
.ornament-mark svg { width: 100%; height: 100%; display: block; }

/* Zier-Flourish unter zentrierten Ueberschriften (Landing-H2, Section-Titel
   auf zentrierten Seiten). Kleines symmetrisches Blattpaar. */
.lp-h2 { position: relative; }
.lp-h2::after {
  content: "";
  display: block;
  width: 54px; height: 12px;
  margin: 12px auto 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  /* zwei spiegelbildliche Blaetter um einen Mittelpunkt (Gold) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 54 12'%3E%3Cg fill='none' stroke='%23c08a2d' stroke-width='1.3' stroke-linecap='round'%3E%3Cpath d='M27 6h-13'/%3E%3Cpath d='M27 6h13'/%3E%3C/g%3E%3Cg fill='%23c08a2d'%3E%3Ccircle cx='27' cy='6' r='2.1'/%3E%3Cpath d='M14 6c-3-2-7-2-9 0 3 2 7 2 9 0z'/%3E%3Cpath d='M40 6c3-2 7-2 9 0-3 2-7 2-9 0z'/%3E%3C/g%3E%3C/svg%3E");
}

/* Botanisches Hero-Hintergrundmotiv: sehr blasse Blatt/Ast-Silhouetten in den
   oberen Ecken, damit der Hero weniger flaechig wirkt. */
.lp-hero { position: relative; overflow: hidden; }
.lp-hero::before,
.lp-hero::after {
  content: "";
  position: absolute;
  width: 260px; height: 260px;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.10;
  pointer-events: none;
  z-index: 0;
  /* zarter Zweig mit Blaettern (weiss, da auf dunklem Hero) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M20 90 Q40 55 55 20'/%3E%3Cpath d='M34 64 Q46 60 54 50'/%3E%3Cpath d='M30 72 Q20 70 12 74'/%3E%3Cpath d='M44 46 Q56 44 62 36'/%3E%3Cpath d='M40 54 Q30 54 23 58'/%3E%3C/g%3E%3Cg fill='%23ffffff'%3E%3Cpath d='M54 50c6-3 11-2 13 2-6 3-11 2-13-2z'/%3E%3Cpath d='M62 36c5-4 10-4 13 0-5 4-10 4-13 0z'/%3E%3Cpath d='M23 58c-6-2-11 0-13 4 6 2 11 0 13-4z'/%3E%3C/g%3E%3C/svg%3E");
}
.lp-hero::before { top: -40px; left: -30px; transform: rotate(-8deg); }
.lp-hero::after  { bottom: -50px; right: -30px; transform: scaleX(-1) rotate(-8deg); }
.lp-hero-inner { position: relative; z-index: 1; }

/* Zier-Eck an Feature-/Preis-Karten: feine Gold-Ecklinien oben links/rechts. */
.lp-feature, .lp-price-card { position: relative; }
.lp-feature::before, .lp-price-card::before {
  content: "";
  position: absolute; top: 10px; left: 10px;
  width: 16px; height: 16px;
  border-top: 1.5px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-left: 1.5px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-top-left-radius: 6px;
  opacity: 0.8;
}
.lp-feature::after, .lp-price-card::after {
  content: "";
  position: absolute; top: 10px; right: 10px;
  width: 16px; height: 16px;
  border-top: 1.5px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-right: 1.5px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-top-right-radius: 6px;
  opacity: 0.8;
}

/* Verziertes Preis-Badge: kleine Blattenden links/rechts am "Beliebt"-Band. */
.lp-price-badge { position: relative; }
.lp-price-badge::before,
.lp-price-badge::after {
  content: "❧";
  font-size: 11px;
  opacity: 0.9;
  margin: 0 2px;
  vertical-align: middle;
}

/* Dezenter Zierrahmen um die Baum-Arbeitsflaeche (doppelte feine Linie). */
.tree-wrap {
  box-shadow: inset 0 0 0 1px var(--border),
              inset 0 0 0 5px #fff,
              inset 0 0 0 6px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* Zier-Flourish auch an zentrierten Section-Titeln der App-Seiten
   (Upgrade/Profil/Admin-Ueberschriften bleiben unveraendert; nur Landing). */
.lp-cta h2 { position: relative; }
.lp-cta h2::after {
  content: "";
  display: block;
  width: 54px; height: 12px;
  margin: 12px auto 0;
  background: no-repeat center/contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 54 12'%3E%3Cg fill='none' stroke='%23c08a2d' stroke-width='1.3' stroke-linecap='round'%3E%3Cpath d='M27 6h-13'/%3E%3Cpath d='M27 6h13'/%3E%3C/g%3E%3Cg fill='%23c08a2d'%3E%3Ccircle cx='27' cy='6' r='2.1'/%3E%3Cpath d='M14 6c-3-2-7-2-9 0 3 2 7 2 9 0z'/%3E%3Cpath d='M40 6c3-2 7-2 9 0-3 2-7 2-9 0z'/%3E%3C/g%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  .lp-hero::before, .lp-hero::after { opacity: 0.07; }
}

/* ── Mitbearbeiter / Freigaben (Baum teilen) ─────────────────────────────── */
.share-box {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(192, 138, 45, 0.05);
}
.share-form {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}
.share-form .search-input { margin: 0; flex: 1; }
.share-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.share-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-top: 1px solid var(--border);
  font-size: 0.9em;
}
.share-list form { margin: 0; }
.btn-remove-share {
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 1.2em;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.btn-remove-share:hover { opacity: 0.7; }
.share-msg {
  font-size: 0.85em;
  margin: 6px 0;
  padding: 6px 8px;
  border-radius: 6px;
}
.share-msg.ok { background: rgba(60, 130, 70, 0.12); color: #2f6d3a; }
.share-msg.err { background: rgba(180, 68, 47, 0.12); color: var(--danger); }
.shared-note {
  font-size: 0.85em;
  color: var(--accent);
  margin: 10px 0;
  font-style: italic;
}

/* Geteilte Baeume in der Uebersicht markieren */
.tree-card-shared {
  border-left: 3px solid var(--accent);
}
.shared-badge {
  display: inline-block;
  font-size: 0.8em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
  background: rgba(192, 138, 45, 0.06);
}

/* Admin: Feature-Wuensche */
.admin-section-title {
  margin: 32px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.feature-desc {
  font-size: 0.88em;
  color: var(--muted);
  margin-top: 4px;
  white-space: pre-wrap;
}

/* ── Cookie-Einwilligung (Consent-Banner) ────────────────────────────────── */
.ds-consent {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 32px));
  background: #fff;
  color: var(--text, #2b2622);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
  padding: 16px 18px;
  z-index: 2000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}
.ds-consent[hidden] { display: none; }
.ds-consent-text {
  flex: 1 1 320px;
  font-size: 0.9em;
  line-height: 1.5;
  color: var(--muted);
}
.ds-consent-text a { color: var(--accent); }
.ds-consent-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
@media (max-width: 520px) {
  .ds-consent { flex-direction: column; align-items: stretch; }
  .ds-consent-actions { justify-content: flex-end; }
}

/* ── Cookie-Einstellungen-Dialog (granular) ──────────────────────────────── */
.ds-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ds-dialog-backdrop[hidden] { display: none; }
.ds-dialog {
  background: #fff;
  color: var(--text, #2b2622);
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 24px;
}
.ds-dialog h2 { margin: 0 0 6px; }
.ds-dialog-intro { color: var(--muted); font-size: 0.9em; margin: 0 0 16px; }
.ds-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.ds-cat-info { display: flex; flex-direction: column; }
.ds-cat-info strong { font-size: 0.98em; }
.ds-cat-info span { font-size: 0.82em; color: var(--muted); }
.ds-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
/* Toggle-Switch */
.ds-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 auto; }
.ds-switch input { opacity: 0; width: 0; height: 0; }
.ds-switch span {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cfc6b8;
  border-radius: 999px;
  transition: background 0.2s;
}
.ds-switch span::before {
  content: "";
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.ds-switch input:checked + span { background: var(--accent); }
.ds-switch input:checked + span::before { transform: translateX(20px); }
.ds-switch input:disabled + span { opacity: 0.6; cursor: not-allowed; }

/* ── Mehrere Personen anlegen (Bulk-Modal) ───────────────────────────────── */
.sidebar-head-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.modal.modal-wide { width: min(760px, 96vw); max-width: 760px; }
.bulk-hint { margin: 0 0 12px; font-size: 0.88em; }
.bulk-table-wrap { max-height: 55vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.bulk-table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.bulk-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--bg);
  position: sticky; top: 0;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.bulk-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.bulk-table input, .bulk-table select {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.bulk-table .b-birth { min-width: 140px; }
.bulk-row-del {
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 1.2em;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}
.bulk-row-del:hover { opacity: 0.7; }
