//! UTF-8-safe string truncation utilities
/// Safely truncate a string to a maximum number of CHARACTERS (not bytes).
///
/// Respects UTF-8 character boundaries - never panics on multi-byte characters.
///
/// # Performance
/// * O(n) where n = max_chars (iterates through characters)
/// * Zero allocation - returns slice of original string
/// 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).