//! Small UTF-8-safe string helpers shared across crates.
/// Return the prefix of `s` containing at most `max_chars` characters, always
/// landing on a UTF-8 char boundary. Replaces the `&s[..N]` byte-slicing
/// (Pattern B in the 2026-05-29 audit) that panics when byte `N` falls inside a
/// multi-byte character.