/** Short, URL-safe random ids (10 chars, ~60 bits). Works in browsers and Node. */ export function newId(): string { const bytes = new Uint8Array(8); crypto.getRandomValues(bytes); let id = ''; for (const b of bytes) id += b.toString(36).padStart(2, '0'); return id.slice(0, 10); }