pub(crate) fn resolve_styles( document: &Document, ) -> (PageStyle, TextStyle, Vec<Diagnostic>)
Walk root children in source order and fold each #set page(...) and #set text(...) into a PageStyle / TextStyle. Later directives win (last-write-wins). #set document(...) is consumed by the lowerer for PDF metadata and ignored here.
#set page(...)
#set text(...)
PageStyle
TextStyle
#set document(...)