/* ═══════════════════════════════════════════════════════
   FEATURE 1: IF-ROUTEN STAMMBAUM (Canvas)
   ═══════════════════════════════════════════════════════ */

.stammbaum-wrap {
  position: relative;
  width: 100%;
  padding: 32px 0 0;
}

.stammbaum-canvas-container {
  position: relative;
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  background: rgba(6,5,14,.6);
  border-radius: 4px;
}

#timeline-canvas {
  display: block;
  min-width: 1100px;
  width: 100%;
  height: 560px;
  cursor: crosshair;
}

/* Tooltip */
.stammbaum-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-card);
  border: 1px solid var(--border2);
  padding: 10px 14px;
  font-family: 'Crimson Pro', serif;
  font-size: 14px;
  color: var(--text-main);
  max-width: 280px;
  z-index: 100;
  opacity: 0;
  transition: opacity .15s;
  box-shadow: var(--glow);
}
.stammbaum-tooltip.visible { opacity: 1; }
.stammbaum-tooltip .tt-title {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
  letter-spacing: .05em;
}
.stammbaum-tooltip .tt-desc {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Legende */
.stammbaum-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 20px 0 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend-swatch {
  width: 18px;
  height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}
.legend-swatch.dashed {
  background: none;
  border-top: 2px dashed currentColor;
  height: 0;
}

@media (max-width: 640px) {
  #timeline-canvas { height: 440px; }
  .stammbaum-legend { font-size: 10px; gap: 8px 14px; }
}
