/* ═══════════════════════════════════════════════════════
   BEZIEHUNGSNETZ
   ═══════════════════════════════════════════════════════ */

.relations-wrap {
  position: relative;
  width: 100%;
}

.relations-canvas-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(6,5,14,.6);
  border-radius: 4px;
}

#relations-canvas {
  display: block;
  width: 100%;
  height: 600px;
  cursor: grab;
}
#relations-canvas:active { cursor: grabbing; }

.relations-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: 250px;
  z-index: 100;
  opacity: 0;
  transition: opacity .15s;
  box-shadow: var(--glow);
}
.relations-tooltip.visible { opacity: 1; }
.relations-tooltip .rt-title {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}
.relations-tooltip .rt-desc {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.relations-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 16px 0 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}
.relations-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.relations-legend-line {
  width: 24px;
  height: 0;
  border-top: 2px solid currentColor;
  flex-shrink: 0;
}
.relations-legend-line.dashed {
  border-top-style: dashed;
}

.relations-filter-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.rel-filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .08em;
  cursor: pointer;
  transition: all .2s;
}
.rel-filter-btn:hover {
  border-color: var(--border2);
  color: var(--text-main);
}
.rel-filter-btn.active {
  background: rgba(139,92,246,.12);
  border-color: var(--accent1);
  color: var(--accent1);
}

@media (max-width: 640px) {
  #relations-canvas { height: 450px; }
}
