/** Stable anchor id for a subtopic name (plain module: callable from server and client components). */ export function subtopicAnchor(prefix: string, subtopic: string): string { return `${prefix}-${subtopic.toLowerCase().replace(/&/g, 'and').replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '')}`; }