Local structure and density fluctuations in confined fluids