ng() {
    btnPrimary.disabled = false;
    loadingOverlay.classList.add('hidden');
}
async function waitForPidChange(oldPid, timeout = 5000) {
    const start = Date.now();
    while (Date.now() - start < timeout) {
        const status = await run('pgrep -f "nfqws" >/dev/null && echo "Running" || echo "Stopped"');
        if (oldPid === 'Stopped' ? status.trim() === 'Running' : status.trim() === 'Stopped') {
            return status;
        }
        await new Promise(res => setTimeout(res, 500));
    }