/* ── MAIN ────────────────────────────────────────────────── */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

#cy {
  flex: 1;
  width: 100%;
  background: var(--cy-bg);
}

/* Faded elements (for highlight/drill mode) */
#cy .faded {
  opacity: 0.2;
}

.cy-controls {
  position: absolute;
  bottom: 36px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: var(--z-overlay);
}

.cy-controls button {
  width: 32px;
  height: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgb(0 0 0 / 30%);
}

.cy-controls button:hover {
  background: var(--surface2);
}

/* ── EXPORT CONTROLS ───────────────────────────────────────── */
.export-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.export-controls .dropdown {
  position: absolute;
  bottom: 0;
  right: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 30%);
  z-index: calc(var(--z-overlay) + 1);
  min-width: 70px;
  overflow: hidden;
}

.export-controls .dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 11px;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
  white-space: nowrap;
}

.export-controls .dropdown-item:hover {
  background: var(--surface2);
  color: var(--text);
}

/* ── GRAPH LEGEND ──────────────────────────────────────────── */
#graph-legend {
  position: absolute;
  z-index: var(--z-overlay);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.75rem;
  min-width: 140px;
  max-width: 220px;
  cursor: grab;
  user-select: none;
}

.legend-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 2px;
}

.legend-section-label:first-child {
  margin-top: 0;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 0;
  color: var(--text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--dot-color);
}

.legend-type-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#export-loading {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}
