Context. Star-forming regions may play an important role in the life cycle of Galactic cosmic rays (CRs), notably as home to specific acceleration mechanisms and transport conditions. Gamma-ray observations of Cygnus X have revealed the presence of an excess of hard-spectrum gamma-ray emission, possibly related to a cocoon of freshly accelerated particles.Aims. We seek an improved description of the gamma-ray emission from the cocoon using ~13 yr of observations with theFermi-Large Area Telescope (LAT) and use it to further constrain the processes and objects responsible for the young CR population.Methods. We developed an emission model for a large region of interest, including a description of interstellar emission from the background population of CRs and recent models for other gamma-ray sources in the field. Thus, we performed an improved spectro-morphological characterisation of the residual emission including the cocoon.Results. The best-fit model for the cocoon includes two main emission components: an extended component FCES G78.74+1.56, described by a 2D Gaussian of extensionr68= 4.4° ± 0.1°−0.1°+0.1°and a smooth broken power law spectrum with spectral indices 1.67 ± 0.05−0.01+0.02and 2.12 ± 0.02−0.01+0.00below and above 3.0 ± 0.6−0.2+0.0GeV, respectively; and a central component FCES G80.00+0.50, traced by the distribution of ionised gas within the borders of the photo-dissociation regions and with a power law spectrum of index 2.19 ± 0.03−0.01+0.00that is significantly different from the spectrum of FCES G78.74+1.56. An additional extended emission component FCES G78.83+3.57, located on the edge of the central cavities in Cygnus X and with a spectrum compatible with that of FCES G80.00+0.50, is likely related to the cocoon. For the two brightest components FCES G80.00+0.50 and FCES G78.74+1.56, spectra and radial-azimuthal profiles of the emission can be accounted for in a diffusion-loss framework involving one single population of non-thermal particles with a flat injection spectrum. Particles span the full extent of FCES G78.74+1.56 as a result of diffusion from a central source, and give rise to source FCES G80.00+0.50 by interacting with ionised gas in the innermost region.Conclusions. For this simple diffusion-loss model, viable setups can be very different in terms of energetics, transport conditions, and timescales involved, and both hadronic and leptonic scenarios are possible. The solutions range from long-lasting particle acceleration, possibly in prominent star clusters such as Cyg OB2 and NGC 6910, to a more recent and short-lived release of particles within the last 10–100 kyr, likely from a supernova remnant. The observables extracted from our analysis can be used to perform detailed comparisons with advanced models of particle acceleration and transport in star-forming regions.