/* ============================================================
   Graph — workspace graph view (light + dark)
   Scoped under .graph-root. The canvas does all the rendering;
   the DOM here is just chrome: controls, counts, empty hint.
   ============================================================ */

.graph-root {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px; /* fallback when the host container is auto-height */
  overflow: hidden;
  background: var(--bg);
}

.graph-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none; /* pointer events own pan/drag on touch */
}
.graph-canvas.is-pointer { cursor: pointer; }
.graph-canvas.is-grabbing { cursor: grabbing; }

/* ---- floating control cluster ---- */
.graph-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  user-select: none;
}
.graph-btn {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  color: var(--text-light);
}
.graph-btn:hover { background: var(--bg-hover); color: var(--text); }
.graph-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 5px;
  flex-shrink: 0;
}
.graph-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
  cursor: pointer;
}
.graph-toggle:hover { color: var(--text); }
.graph-toggle input {
  accent-color: var(--accent);
  margin: 0;
  cursor: pointer;
}

/* ---- node/link counts ---- */
.graph-meta {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-size: 12px;
  color: var(--text-faint);
  pointer-events: none;
  user-select: none;
}

/* ---- empty / too-small state ---- */
.graph-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
}
.graph-empty-title { font-size: 17px; font-weight: 600; color: var(--text); }
.graph-empty-sub {
  font-size: 14px;
  color: var(--text-light);
  max-width: 380px;
  line-height: 1.5;
}

/* local hidden utility (mirrors the app-wide convention) */
.graph-root .hidden { display: none !important; }
