New high-resolution observations reveal that small-scale magnetic flux concentrations have a delicate substructure on a spatial scale of 0.1''. Its basic structure can be interpreted in terms of a magnetic flux sheet or tube that vertically extends through the ambient weak-field or field-free atmosphere with which it is in mechanical equilibrium. A more refined interpretation comes from new three-dimensional magnetohydrodynamic simulations that are capable of reproducing the corrugated shape of magnetic flux concentrations and their signature in the visible continuum. Furthermore it is shown that the characteristic asymmetric shape of the contrast profile of facular granules is an effect of radiative transfer across the rarefied atmosphere of the magnetic flux concentration. I also discuss three-dimensional radiation magnetohydrodynamic simulations of the integral layers from the top of the convection zone to the mid-chromosphere. They show a highly dynamic chromospheric magnetic field, marked by rapidly moving filaments of stronger than average magnetic field that form in the compression zone downstream and along propagating shock fronts. The simulations confirm the picture of flux concentrations that strongly expand through the photosphere into a more homogeneous, space filling chromospheric field. Future directions in the simulation of small-scale magnetic fields are indicated by a few examples of very recent work.