/* Root-Container */
#stammbaum-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 3rem;
  gap: 2rem;
}
.stammbaum-titel {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  color: #f0f0f0;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.3);
  letter-spacing: 0.5px;
}
/* Generationszeile */
.generation {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
  border-top: 1px solid #e0e0e0;
  background-color: #f5f5f5;
}

/* Knotenbox */
.knoten {
  position: relative;
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 2.5rem 1.25rem 0.75rem; /* oben mehr Platz für Button */
  background: #f9f9f9;
  box-shadow: 1px 1px 4px rgba(0,0,0,0.1);
  text-align: center;
  min-width: 180px;
  cursor: default;
  transition: transform 0.2s, background 0.3s;
}

.knoten:hover {
  transform: scale(1.02);
  background-color: #f0f8ff;
}

.knoten.paar {
  background: #e6f7ff;
}

.knoten.expanded {
  border-color: #007bff;
  background: #eef7ff;
}

/* Eingeklappt initial */
.hidden {
  display: none;
}

.toggle-arrow {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 1rem;
  font-weight: bold;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.05);
  cursor: pointer;
  user-select: none;
  z-index: 10;
  line-height: 1;
  transition: background 0.2s;
  box-sizing: border-box;
}

.toggle-arrow:hover {
  background-color: rgba(0, 0, 0, 0.12);
}
/* Stammbaum – Dark Mode sanfter gestalten */
html.dark body.baum-page {
  background-color: #181818;
}

html.dark body.baum-page main {
  background-color: #202020;
  color: #e0e0e0;
  box-shadow: none;
}

/* Boxen im Baum */
html.dark .knoten {
  background-color: #292929;
  border-color: #3a3a3a;
  color: #f0f0f0;
}

/* Zwischenrahmen oder Container */
html.dark .generation {
  background-color: #1d1d1d;
  border-color: #333;
}