#topic-graph {
  width: 100%;
  max-width: 900px;
  margin: 2rem auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.graph-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.graph-controls button {
  padding: 0.5rem 1rem;
  border: 1px solid #e5e7eb;
  background: white;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.graph-controls button:hover {
  background: #f3f4f6;
}

.graph-controls button.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

#graph-canvas {
  width: 100%;
  height: 500px;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fafafa;
}

.node {
  cursor: pointer;
  stroke-width: 2px;
  stroke: white;
  transition: all 0.3s;
}

.node:hover {
  stroke-width: 3px;
  stroke: #374151;
}

.node.bridge {
  stroke-width: 3px;
  stroke-dasharray: 5,5;
  stroke: #374151;
}

.node.dimmed {
  opacity: 0.3;
}

.link {
  stroke: #9ca3af;
  stroke-opacity: 0.4;
  stroke-width: 1px;
  transition: all 0.3s;
}

.link.highlighted {
  stroke: #374151;
  stroke-opacity: 0.8;
  stroke-width: 2px;
}

.link.dimmed {
  stroke-opacity: 0.1;
}

.node-label {
  font-size: 11px;
  text-anchor: middle;
  dominant-baseline: central;
  fill: #374151;
  pointer-events: none;
  font-weight: 500;
}

.cluster-label {
  font-size: 14px;
  font-weight: 600;
  fill: #6b7280;
  text-anchor: middle;
  pointer-events: none;
}

.tooltip {
  position: absolute;
  background: #1f2937;
  color: white;
  padding: 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 1000;
  max-width: 200px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.tooltip.visible {
  opacity: 1;
}

@media (max-width: 768px) {
  #topic-graph {
    margin: 1rem;
  }
  
  #graph-canvas {
    height: 400px;
  }
  
  .graph-controls button {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }
}