//! UTF-8-safe string truncation utilities
/// Find a safe byte index for truncation, preferring word boundaries.
///
/// Returns byte index of the last whitespace/punctuation within the first
/// `max_chars` characters. If no boundary found, returns byte index of
/// the `max_chars`-th character (or string length if shorter).