AC leak damage

Had a built-in AC in a story 2 apartment clog up its drain line, allowing water to overflow onto that apartment's wall-to-wall carpet, and through the wall to story 1 apartment's drywall ceiling.
(I asked about this about a month ago. The cause seems to be rusty residue from the drain pan collecting at a bend in the drain line. I've CLR'ed it, but I can't get back into the drain pan to treat the whole thing the way I'd like, because it's built-in. I worry it will happen again, but I'll probably just have to keep an eye on it. Thoroughly flushing the line is impractical.)
The carpet has odd brown stains and white "chalking", probably residue from the floor below (stain and white paint?). Any suggestions on the best way to remove this, along with a good steam cleaning? What about mildew under the carpet? It will probably need replacement eventually (other apartments in the same building had new carpet last year, at the nine-year mark), but preferably not *this* year.
The ceiling is a basic drywall with latex popcorn paint. The paint is peeling away in a few locations, but I'm hoping that as the drywall dries out completely, most of the paint will stay in place (perhaps with peeling later on, but we can worry about that then). Should I just treat this like a normal peeling-paint project, chipping off the loose stuff, and repainting normally (due to visibility and small damage area I'll probably skip the texturing)?
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Mildew under that carpet should not be a problem, unless this went on for a long time. Mildew generally doesn't form over night. I'd get a carpet cleaning company in to clean it.
The ceiling is harder to tell without seeing it. If it drys out and it's just some peeling paint, then you can get the loose paint off, do any prep work, give it a first coat of stain killer, then 2 coats of paint. Though if it's textured, I don't see how you can fix it so it looks decent without retexturing areas where the texturing has been damaged.
Finally, I'd get an air conditioning company in to give you advice so this doesn't happen again. Units like this should have a safety switch that cuts it off if the water backs up.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

HomeOwnersHub.com is a website for homeowners and building and maintenance pros. It is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.