pub fn find_boundary(s: &str, max: usize) -> usize
Find a safe UTF-8 boundary position. Returns the largest position <= max that is a valid char boundary.