/* referrals.css — graph layout + legend.
   Mobile: graph full-width, legend below. ≥900px: graph + sidebar. */

.rf-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 900px) {
  .rf-layout { grid-template-columns: minmax(0, 7fr) minmax(220px, 3fr); gap: 16px; }
}

.rf-graph-wrap {
  background: white;
  overflow: hidden;
  border-radius: 12px;
  min-height: 420px;
  position: relative;
}

#rf-svg {
  width: 100%;
  height: 100%;
  min-height: 420px;
  cursor: grab;
  user-select: none;
  display: block;
}
#rf-svg:active { cursor: grabbing; }

.rf-edge {
  stroke: var(--hairline-bold);
  stroke-width: 1.2;
  opacity: 0.7;
}

.rf-node {
  cursor: pointer;
  transition: transform 0.15s;
}
.rf-node:hover circle { stroke-width: 3; }
.rf-node circle {
  stroke: white;
  stroke-width: 2;
  transition: stroke-width 0.15s;
}
/* W8 audit fix — visible focus ring when nodes get keyboard focus
   (tabindex=0 + role=button on the <g>). */
.rf-node:focus { outline: none; }
.rf-node:focus circle,
.rf-node:focus-visible circle {
  stroke: var(--ink-2);
  stroke-width: 3;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.35));
}

.rf-node.lvl0 circle { fill: var(--lime); }
.rf-node.lvl1 circle { fill: var(--lime-bright); }
.rf-node.lvl2 circle { fill: #FBBF24; }
.rf-node.lvl3 circle { fill: #94A3B8; }

.rf-node text {
  pointer-events: none;
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  fill: var(--ink);
  text-anchor: middle;
}
.rf-node.lvl0 text { fill: white; font-size: 11px; font-weight: 700; }

.rf-legend-card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 14px 16px;
}
.rf-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.rf-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  flex-shrink: 0;
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--hairline);
}
.rf-dot.lvl0 { background: var(--lime); }
.rf-dot.lvl1 { background: var(--lime-bright); }
.rf-dot.lvl2 { background: #FBBF24; }
.rf-dot.lvl3 { background: #94A3B8; }
