/* Sankey Chart Container */
#sankey_container {
  overflow-x: hidden;
  --text-color: #333;
  --tooltip-bg: rgba(20, 22, 28, 0.95);
  --tooltip-text: #e6e6e6;
}

/* SVG responsive */
#sankey_container #sankey_chart_svg svg,
#sankey_container svg {
  width: 100%;
  height: auto;
  display: block;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
}

/* Links */
#sankey_container .links path {
  cursor: pointer;
  transition: opacity 0.2s ease, stroke-width 0.2s ease;
}

/* Nodes */
#sankey_container .node rect {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

#sankey_container .node text {
  font-size: 11px;
  fill: var(--text-color);
  font-weight: 500;
  user-select: none;
}

/* Tooltip */
#sankey_container .tooltip {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  z-index: 1000;
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  border: 1px solid #2a2d34;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  line-height: 1.4;
  max-width: 280px;
}

/* Legend */
#sankey_container #sankey_chart_legend {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
}

#sankey_container #sankey_chart_legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #sankey_container .node text {
    font-size: 10px;
  }

  #sankey_container #sankey_chart_legend {
    gap: 12px;
    font-size: 12px;
  }
}
