:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #657182;
  --line: #d9e0e7;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --sage: #e31b23;
  --sage-dark: #b5121b;
  --coral: #e31b23;
  --gold: #ffffff;
  --blue: #c91822;
  --shadow: 0 18px 45px rgba(26, 37, 53, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
}

.hero {
  position: relative;
  min-height: clamp(430px, 68vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}

.hero__image,
.hero__scrim {
  position: absolute;
  inset: 0;
}

.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.hero__scrim {
  background:
    linear-gradient(90deg, rgba(4, 9, 18, 0.82) 0%, rgba(4, 9, 18, 0.58) 38%, rgba(4, 9, 18, 0.18) 100%),
    linear-gradient(180deg, rgba(2, 6, 14, 0.34), rgba(2, 6, 14, 0.12));
  z-index: -1;
}

.topbar {
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--ink);
}

.brand__mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-size: 0.86rem;
  letter-spacing: 0;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(24, 33, 47, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(10px);
}

.tab {
  border: 0;
  border-radius: 6px;
  padding: 10px 13px;
  min-height: 40px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.tab.is-active {
  background: var(--ink);
  color: white;
}

.hero__content {
  width: min(1180px, calc(100% - 32px));
  margin: auto;
  padding: 54px 0 78px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--sage-dark);
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 0.08em;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.35rem, 6vw, 5.85rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.hero .eyebrow {
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

.hero h1 {
  color: #ffffff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.48);
}

.hero-subtitle {
  max-width: 560px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(1.18rem, 2vw, 1.8rem);
  line-height: 1.35;
  font-weight: 700;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.45);
}

.hero .brand {
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

.hero .brand__mark {
  background: var(--sage);
  box-shadow: 0 10px 26px rgba(227, 27, 35, 0.28);
}

.hero .tabs {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(9, 16, 28, 0.42);
}

.hero .tab {
  color: rgba(255, 255, 255, 0.82);
}

.hero .tab.is-active {
  background: var(--sage);
  color: #ffffff;
}


.hero__actions,
.button-row,
.tool-row,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero__actions {
  margin-top: 28px;
}

.primary-action,
.secondary-action,
.danger-action,
.link-action,
.icon-button {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.primary-action,
.link-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  background: var(--sage);
  color: white;
  box-shadow: 0 10px 22px rgba(227, 27, 35, 0.26);
}

.secondary-action {
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--sage-dark);
  border: 1px solid rgba(227, 27, 35, 0.20);
}

.danger-action {
  padding: 11px 16px;
  background: #fff1ed;
  color: #a6412e;
  border: 1px solid #f3c7bd;
}

.compact {
  min-height: 40px;
  padding: 9px 14px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 1.2rem;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: -44px auto 60px;
  position: relative;
  z-index: 2;
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.summary-item {
  min-height: 96px;
  padding: 20px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.summary-item__value {
  font-size: 2rem;
  line-height: 1;
  font-weight: 900;
  color: var(--blue);
}

.summary-item__label {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
}

.view {
  display: none;
  padding-top: 36px;
}

.view.is-visible {
  display: block;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(227, 27, 35, 0.14);
}

.search input {
  width: min(320px, 48vw);
}

.tree-board {
  min-height: 420px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  overflow-x: auto;
}

.generation {
  min-width: 760px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  align-items: stretch;
  position: relative;
}

.generation + .generation {
  margin-top: 42px;
  padding-top: 42px;
  border-top: 1px dashed #c7d2dd;
}

.person-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  min-height: 152px;
  box-shadow: 0 12px 28px rgba(26, 37, 53, 0.08);
}

.person-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 8px 0 0 8px;
  background: var(--accent, var(--sage));
}

.person-top {
  display: flex;
  align-items: center;
  gap: 11px;
}

.avatar {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff1f2;
  color: var(--sage-dark);
  font-weight: 900;
}

.person-card h3 {
  margin: 0;
  line-height: 1.1;
  font-size: 1rem;
}

.person-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.person-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.card-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--sage-dark);
  font-weight: 900;
  cursor: pointer;
  padding: 0;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.share-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.share-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 12px 28px rgba(26, 37, 53, 0.08);
}

.sync-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 8px;
  background: #f4f7f5;
  border: 1px solid #dbe6de;
}

.sync-card strong,
.sync-card span {
  display: block;
}

.sync-card strong {
  color: var(--ink);
}

.sync-card span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.sync-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(199, 154, 66, 0.16);
}

.sync-dot.is-online {
  background: var(--sage);
  box-shadow: 0 0 0 4px rgba(227, 27, 35, 0.16);
}

.sync-dot.is-error {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(212, 106, 85, 0.16);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.button-row {
  margin-top: 12px;
}

.person-dialog {
  width: min(760px, calc(100% - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 30px 80px rgba(24, 33, 47, 0.24);
}

.person-dialog::backdrop {
  background: rgba(24, 33, 47, 0.45);
}

.person-dialog form {
  padding: 20px;
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.wide {
  grid-column: 1 / -1;
}

.dialog-actions {
  margin-top: 18px;
}

.spacer {
  flex: 1;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  max-width: min(520px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 800;
  box-shadow: var(--shadow);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 760px) {
  .hero {
    min-height: 590px;
  }

  .hero__scrim {
    background: linear-gradient(180deg, rgba(251, 250, 247, 0.92) 0%, rgba(251, 250, 247, 0.8) 58%, rgba(251, 250, 247, 0.36) 100%);
  }

  .topbar,
  .section-heading,
  .share-layout {
    display: grid;
  }

  .tabs {
    width: 100%;
    overflow-x: auto;
  }

  .tab {
    flex: 1 0 auto;
  }

  h1 {
    font-size: clamp(2.25rem, 13vw, 3.7rem);
  }

  main {
    margin-top: -28px;
  }

  .summary-band {
    grid-template-columns: 1fr;
  }

  .tool-row,
  .search,
  .search input {
    width: 100%;
  }

  .tree-board {
    padding: 14px;
  }

  .generation {
    min-width: 620px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}


/* Grafische Stammbaumansicht */
.tree-board {
  position: relative;
  min-height: 560px;
  padding: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(251,250,247,0.86));
  overflow: auto;
}

.tree-controls {
  position: sticky;
  top: 12px;
  left: 12px;
  z-index: 8;
  display: flex;
  gap: 8px;
  width: max-content;
  padding: 10px;
}

.tree-controls .icon-button {
  min-width: 42px;
  width: auto;
  padding: 0 12px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 8px 20px rgba(26, 37, 53, 0.08);
}

.family-tree-viewport {
  position: relative;
  min-width: 100%;
  min-height: 520px;
}

.family-tree-canvas {
  position: relative;
}

.family-tree-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}

.tree-line {
  fill: none;
  stroke: #8a98a8;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tree-line--partner {
  stroke: #c91822;
  stroke-width: 3;
}

.tree-line--child {
  stroke: #9aa8b6;
}

.tree-node {
  position: absolute;
  z-index: 2;
  width: 230px;
}

.tree-node-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: start;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  box-shadow: 0 12px 28px rgba(26, 37, 53, 0.1);
}

.tree-node-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 8px 0 0 8px;
  background: var(--accent, var(--sage));
}

.tree-node-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff1f2;
  color: var(--sage-dark);
  font-weight: 900;
}

.tree-node-main strong,
.tree-node-main span,
.tree-node-main small {
  display: block;
}

.tree-node-main strong {
  line-height: 1.12;
  font-size: 0.98rem;
}

.tree-node-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.tree-node-main small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.tree-node-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  padding-left: 4px;
}

@media (max-width: 760px) {
  .tree-board {
    min-height: 520px;
  }

  .tree-node {
    width: 210px;
  }

  .tree-node-card {
    grid-template-columns: 38px 1fr;
  }

  .tree-node-avatar {
    width: 38px;
    height: 38px;
  }
}


/* Türkisches Rot-Weiß-Farbdesign */
.summary-item__value {
  color: var(--sage);
}

.text-button {
  color: var(--sage-dark);
}

.primary-action:hover,
.link-action:hover,
.tab.is-active:hover {
  background: #c91822;
}

.secondary-action:hover {
  background: #fff5f5;
  border-color: rgba(227, 27, 35, 0.36);
}

.tree-node-card:hover,
.person-card:hover {
  border-color: rgba(227, 27, 35, 0.36);
}

.icon-button:hover {
  color: var(--sage);
  border-color: rgba(227, 27, 35, 0.25);
}


/* Finaler Feinschliff: Logo entfernt, Navigation rechts, scharfes Panorama */
.topbar {
  justify-content: flex-end;
}

.brand,
.brand__mark {
  display: none !important;
}

.hero {
  min-height: clamp(390px, 56vh, 590px);
}

.hero__image {
  object-position: center center;
}

.hero__content {
  padding-top: 64px;
}

@media (max-width: 760px) {
  .topbar {
    justify-content: stretch;
  }

  .tabs {
    justify-content: center;
  }

  .hero {
    min-height: 560px;
  }
}

/* Verwandtschaft direkt aus einer Person heraus hinzufügen */
.relation-dialog {
  width: min(720px, calc(100% - 24px));
  border: 0;
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 30px 80px rgba(24, 33, 47, 0.24);
}

.relation-dialog::backdrop {
  background: rgba(24, 33, 47, 0.52);
}

.relation-box {
  padding: 22px;
  background: var(--surface);
  border-top: 5px solid var(--sage);
}

.relation-box .eyebrow {
  color: var(--sage-dark);
}

.relation-help {
  margin: 0 0 18px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.relation-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.relation-action {
  min-height: 52px;
  border: 1px solid rgba(227, 27, 35, 0.18);
  border-radius: 10px;
  background: #fff7f7;
  color: var(--sage-dark);
  font-weight: 900;
  cursor: pointer;
  text-align: left;
  padding: 14px 16px;
  box-shadow: 0 10px 22px rgba(26, 37, 53, 0.06);
}

.relation-action:hover {
  border-color: rgba(227, 27, 35, 0.42);
  background: #fff1f2;
  transform: translateY(-1px);
}

.relation-action--male {
  border-left: 5px solid #294f73;
}

.relation-action--female {
  border-left: 5px solid #d46a55;
}

.relation-action--spouse {
  border-left: 5px solid var(--sage);
  grid-column: 1 / -1;
}

.tree-node-actions,
.card-actions {
  flex-wrap: wrap;
  row-gap: 8px;
}

.tree-node-actions .text-button,
.card-actions .text-button {
  white-space: nowrap;
}

.person-dialog .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 760px) {
  .relation-actions {
    grid-template-columns: 1fr;
  }

  .person-dialog .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Mehr Fläche für den Stammbaum + Geni-ähnliche Profilkacheln */
main {
  width: min(1680px, calc(100% - 24px));
}

.tree-board {
  min-height: clamp(760px, 74vh, 980px);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(249,249,247,0.92));
}

.family-tree-viewport {
  min-height: 760px;
}

.tree-node {
  width: 340px;
}

.geni-card {
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(141, 154, 171, 0.55);
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(26, 37, 53, 0.10);
}

.tree-node-card.geni-card {
  display: grid;
  grid-template-columns: 82px 1fr;
  grid-template-rows: auto auto;
  gap: 0;
  align-items: stretch;
  min-height: 178px;
  padding: 0;
}

.tree-node-card::before,
.person-card::before {
  display: none;
}

.geni-card.is-male {
  background: linear-gradient(180deg, #eef7ff 0%, #dceeff 100%);
  border-color: #a9cdec;
}

.geni-card.is-female {
  background: linear-gradient(180deg, #fff2f7 0%, #f9dce8 100%);
  border-color: #eab4c9;
}

.geni-card.is-unknown {
  background: linear-gradient(180deg, #f8fafc 0%, #eef1f4 100%);
  border-color: #cfd8e3;
}

.geni-photo {
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.62);
  color: rgba(24, 33, 47, 0.54);
  border-right: 1px solid rgba(141, 154, 171, 0.35);
}

.tree-photo {
  min-height: 132px;
}

.geni-photo span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(141, 154, 171, 0.36);
  font-size: 2rem;
  line-height: 1;
}

.geni-card.is-male .geni-photo span {
  color: #2c6ca3;
}

.geni-card.is-female .geni-photo span {
  color: #bd5676;
}

.tree-node-main {
  padding: 14px 14px 10px;
}

.tree-node-main strong {
  font-size: 1.05rem;
  color: #172033;
}

.tree-node-main span {
  margin-top: 6px;
  font-size: 0.86rem;
  color: #536173;
}

.tree-node-main small {
  margin-top: 9px;
  font-size: 0.78rem;
  color: #687586;
}

.tree-node-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 0;
  border-top: 1px solid rgba(141, 154, 171, 0.3);
  background: rgba(141, 154, 171, 0.25);
}

.tree-node-actions .text-button {
  min-height: 38px;
  padding: 7px 6px;
  background: rgba(255,255,255,0.72);
  font-size: 0.74rem;
  text-align: center;
}

.tree-node-actions .text-button:hover {
  background: rgba(255,255,255,0.96);
}

.person-card.geni-card {
  min-height: auto;
  padding: 0;
  display: grid;
  grid-template-columns: 96px 1fr;
  grid-template-rows: auto auto;
}

.person-card.geni-card .geni-photo {
  min-height: 128px;
}

.person-card.geni-card .geni-body {
  padding: 14px;
}

.person-card.geni-card h3 {
  margin: 0;
  font-size: 1.08rem;
}

.person-card.geni-card .card-actions {
  grid-column: 1 / -1;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid rgba(141, 154, 171, 0.3);
  background: rgba(141, 154, 171, 0.25);
}

.person-card.geni-card .card-actions .text-button {
  min-height: 38px;
  padding: 8px;
  background: rgba(255,255,255,0.72);
  text-align: center;
  font-size: 0.78rem;
}

.form-grid label:has(#gender) select {
  min-height: 44px;
}

@media (max-width: 760px) {
  main {
    width: min(100% - 16px, 1680px);
  }

  .tree-board {
    min-height: 680px;
  }

  .tree-node {
    width: 250px;
  }

  .tree-node-card.geni-card {
    grid-template-columns: 72px 1fr;
  }

  .tree-node-actions,
  .person-card.geni-card .card-actions {
    grid-template-columns: 1fr;
  }
}


/* Erweiterte Personendaten: Profilbild, Lebensstatus, Geni-Trauerbalken */
.person-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-upload-field {
  margin-top: 2px;
}

.profile-upload-box {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
}

.profile-preview {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(141, 154, 171, 0.45);
  background: linear-gradient(180deg, #f8fafc, #e9eef4);
  color: #7a8796;
  font-size: 2.8rem;
  font-weight: 900;
}

.profile-preview.is-male {
  background: linear-gradient(180deg, #eef7ff, #dceeff);
  color: #2c6ca3;
}

.profile-preview.is-female {
  background: linear-gradient(180deg, #fff2f7, #f9dce8);
  color: #bd5676;
}

.profile-preview img,
.geni-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-upload-actions {
  display: grid;
  gap: 9px;
}

.profile-upload-actions input[type="file"] {
  padding: 9px;
  background: #ffffff;
}

.profile-upload-actions small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.geni-photo {
  position: relative;
  overflow: hidden;
}

.geni-photo.is-deceased::after,
.profile-preview.is-deceased::after {
  content: "";
  position: absolute;
  left: -34%;
  top: 9%;
  width: 170%;
  height: 12px;
  background: rgba(0, 0, 0, 0.86);
  transform: rotate(-38deg);
  box-shadow: 0 1px 2px rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

.tree-node-card.is-deceased-person .tree-node-main strong,
.person-card.is-deceased-person h3 {
  color: #111827;
}

.tree-node-card.is-deceased-person .tree-node-main span,
.person-card.is-deceased-person .person-meta {
  color: #374151;
}

@media (max-width: 760px) {
  .profile-upload-box {
    grid-template-columns: 1fr;
  }

  .profile-preview {
    width: 100%;
    max-width: 160px;
    margin: 0 auto;
  }
}

/* Profil-Lesemodus und sauberere Stammbaumkarten */
.profile-dialog {
  width: min(720px, calc(100% - 24px));
  border: 0;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 30px 80px rgba(24, 33, 47, 0.24);
}

.profile-dialog::backdrop {
  background: rgba(24, 33, 47, 0.52);
}

.profile-view {
  padding: 22px;
  background: var(--surface);
  border-top: 5px solid var(--sage);
}

.profile-heading {
  align-items: flex-start;
}

.profile-read-layout {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.profile-read-photo {
  min-height: 132px;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.profile-read-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-read-main,
.profile-section {
  display: grid;
  gap: 10px;
}

.profile-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.profile-section h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.profile-section p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.profile-detail-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(217, 224, 231, 0.7);
}

.profile-detail-row span {
  color: var(--muted);
  font-weight: 800;
}

.profile-detail-row strong {
  color: var(--ink);
  font-weight: 900;
}

.tree-node-main small {
  min-height: 1.05em;
}

.tree-node-actions .text-button:first-child,
.card-actions .text-button:first-child {
  color: #1d5fa7;
}

@media (max-width: 760px) {
  .profile-read-layout {
    grid-template-columns: 1fr;
  }

  .profile-read-photo {
    width: 132px;
  }

  .profile-detail-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}


/* Profil-Lesemodus */
.profile-dialog {
  width: min(820px, calc(100% - 24px));
  border: 0;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 30px 80px rgba(24, 33, 47, 0.24);
}

.profile-dialog::backdrop {
  background: rgba(24, 33, 47, 0.52);
}

.profile-view {
  padding: 22px;
  background: var(--surface);
  border-top: 5px solid var(--sage);
}

.profile-view-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  align-items: stretch;
}

.profile-view-photo {
  min-height: 180px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(141, 154, 171, 0.35);
}

.profile-section {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
}

.profile-section h3 {
  margin: 0 0 12px;
  color: var(--ink);
}

.profile-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid rgba(141, 154, 171, 0.22);
}

.profile-row:first-of-type {
  border-top: 0;
}

.profile-row strong {
  color: var(--ink);
}

.profile-row span,
.profile-section p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

/* Family News */
.news-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
}

.news-panel,
.news-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 12px 28px rgba(26, 37, 53, 0.08);
}

.news-panel h3,
.news-card h3 {
  margin: 0 0 12px;
}

.news-list {
  display: grid;
  gap: 14px;
}

.news-card__meta {
  color: var(--sage-dark);
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.news-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
  white-space: pre-wrap;
}

.news-card.is-mourning {
  border-color: #333;
  background: linear-gradient(90deg, #111 0 10px, #fff 10px);
}

.tree-node-actions {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 760px) {
  .profile-view-grid,
  .profile-row,
  .news-layout {
    grid-template-columns: 1fr;
  }

  .tree-node-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* Fix: breitere Stammbaumkarten und vollständig sichtbare Aktionsbuttons */
.tree-node { width: 340px; }
.tree-node-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tree-node-actions .text-button { white-space: normal; line-height: 1.15; }
.person-card.geni-card .card-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.person-card.geni-card .card-actions .text-button { white-space: normal; line-height: 1.15; }


/* Passwortschutz / Zugangssperre */
body.is-locked .app-shell,
body.is-locked .toast {
  display: none !important;
}

.password-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(4, 9, 18, 0.86), rgba(4, 9, 18, 0.54)),
    url("./assets/family-tree-hero.png") center / cover no-repeat,
    var(--ink);
}

body:not(.is-locked) .password-gate {
  display: none !important;
}

.password-card {
  width: min(520px, 100%);
  padding: 28px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.password-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1;
  text-shadow: none;
}

.password-card p:not(.eyebrow) {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.password-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.password-error {
  min-height: 22px;
  color: var(--sage-dark);
  font-weight: 900;
}


/* Kalender & Backup */
.backup-panel h3,
.calendar-panel h3,
.calendar-card h3 {
  margin-top: 0;
}

.backup-panel p,
.backup-hint {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.calendar-list {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.calendar-panel,
.calendar-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 12px 28px rgba(26, 37, 53, 0.08);
}

.calendar-today {
  border-top: 5px solid var(--sage);
}

.calendar-card__date {
  color: var(--sage-dark);
  font-weight: 900;
  margin-bottom: 8px;
}

.calendar-card p {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .calendar-layout {
    grid-template-columns: 1fr;
  }
}
/* Familienbanner Login */
.family-banner-login {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    margin: 0 auto 20px;
    object-fit: contain;
}

/* Familienbanner Family News */
.family-news-header {
    text-align: center;
    margin: 20px 0;
}

.family-news-banner {
    width: 100%;
    max-width: 500px;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}


/* Automatische Geburtstage und Gedenktage */
.calendar-card.is-automatic {
  border-style: dashed;
  background: linear-gradient(180deg, #ffffff 0%, #fff8f8 100%);
}

.calendar-auto-label {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(227, 27, 35, 0.10);
  color: var(--sage-dark);
  font-size: 0.78rem;
  font-weight: 900;
}
