fn buffer_to_ansi_string(buffer: &Buffer) -> String
Convert a Ratatui buffer into ANSI-styled terminal text.