Withdrawing penalty-free from 529 when student received scholarships

We've always just claimed qualified expenses (less those counted against the AOTC) after scholarships for withdrawals from 529s for both kids.  Now the youngest is entering her senior year and it looks like there will be money left in the 529(s) after graduation.  I'm wondering if this year we can claim the entire tuition and fees paid in spring and fall, including the $8000 that were paid by scholarships.  I understand that the $8000 would be taxable (to the student, if the student is the recipient?) but there would be no penalty.  The 529 plan FAQ says to "get a scholarship receipt" but the scholarships are listed on the statements each semester.

 

So what proof is required for the amount of the scholarships in 2025 to be withdrawn penalty-free?  If the student claims the scholarships as income, and DOESN'T take a withdrawal for the fall scholarship (which is being applied to the tuition, since she will be in off-campus housing), will she be able to count that $4000 toward the AOTC?  I believe that with her summer job and $8000 in scholarship income, her AGI will be more than the standard deduction so she will get some benefit from the AOTC (our income is too high to claim it).  Or is she better off taking both scholarships ($4000/semester in 2025) from the 529 and we'll claim her as a dependent on our taxes (meaning we'll get a $500 credit) though does that mean that the taxes on the "unqualified" (?) scholarship distribution will be taxed at our rate?

 

Also, since we have not been taking the amount of the scholarships out of the 529 all along, can we go back after graduation, and after paying off student loans, and close out the account without penalties by claiming scholarships awarded in 2024 and prior years?  Or does the equivalent amount received in scholarships need to be withdrawn from a 529 each calendar year like qualified expenses are?