The Header That Would Not Reach the Edges
The “view as” bar scrolls away and the white header stops short of the column edges. The header had to leave the max-width wrapper, not its margin values.
TL;DR
The sticky manual header was fixed by moving it out of the content wrapper so it spans the full viewport width, using negative margins and matching padding to keep text aligned. The role bar now lives inside that sticky region so it stays reachable while scrolling. Sign-off blocks across three reports were unified into one definition.
While scrolling through the digital manual, two problems appeared at once. The "view as" role bar vanished first, sliding away with the page instead of staying reachable. And the white header bar stopped short of the left and right edges of the screen. It ended exactly where the content column ended.
My first guess was the margin values. Adjust the header's margin, I thought, and the white area would stretch wider. That guess was wrong. The values were never the problem. The header's placement was.
Placement decides the width
The manual header used to sit inside .in, the wrapper that keeps text at a readable measure. Anything inside that wrapper inherits that measure, so the bar could not be wider than the column it lived in. No margin tweak changes that. The fix is to move the header out and make it a direct child of .content instead.
The bar then becomes a sticky region at the top of the viewport. MDN's position reference describes sticky content as something that "will scroll along with its container, until it is at the top of the container (or reaches the offset specified in top), and will then stop scrolling, so it stays visible" [4]. With the offset set to 0, the bar parks at the top and stays there while the page moves under it.
.content > header {
position: sticky;
top: 0;
z-index: 40;
background: var(--surface);
margin: 0 calc(-1 * clamp(1rem, 4vw, 2.5rem)) 1.1rem;
padding: .85rem clamp(1rem, 4vw, 2.5rem) .75rem;
border-bottom: 1px solid var(--border);
}
The full-bleed trick is the pair of matching expressions. The negative inline margin cancels the padding of .content, so the bar touches the left and right edges of the viewport. The padding inside the bar uses the same clamp value, so the text inside stays aligned with the column below it at every viewport width. MDN defines clamp() as a function that "clamps a value within a range" with three parameters, a minimum value, a preferred value, and a maximum allowed value [5], and math expressions inside it may use the four basic operators without wrapping them in calc() [5].
The structure after the change looks like this.
<div class="content">
<header> ... title, meta, chips, role bar ... </header>
<div class="in"> ... page content ... </div>
</div>
Three templates were changed the same way: the index page, the group page, and the document page. The diff comment states the intent plainly. The negative inline margin cancels the .content padding so the bar touches the left and right edges, while the text inside stays aligned with the content.
Controls that have to stay reachable
The "view as" role bar used to sit above the header, which meant it scrolled away with the page. A reader who wanted to switch roles mid-document had to scroll back up first. It now lives inside the sticky region, so it stays on screen as long as the header does.
The filters keep working after the move. Each role button still carries aria-pressed, which flips as the active role changes. MDN states that "adding aria-pressed to an element with a role of button turns the button into a toggle button" [6], so the state is exposed to assistive technology and not only painted on the screen. The rule I took from this: anything a reader may need while reading belongs inside the sticky region, not above it.
One sign-off block across three reports
Reports 4, 5, and 6 carried separate sign-off blocks. They are now unified to one definition, the SOP implementation version with its approver name and signature lines. One definition instead of three copies means a wording change cannot drift between documents.
The PDFs were rebuilt after the change and verified on two axes. The generated markup is identical across the three documents, and the extracted text of the last page matches. Puppeteer's Page.pdf() documentation describes the call as generating "a PDF of the page with the print CSS media type" [7], which is worth holding in mind as a comparative fact when you compare screen output with printed output. What the sticky header actually looks like inside the PDF is something this round did not settle, and I am not claiming it.
To check the change yourself, open the three page types in a browser and compare the header's width with the content column's width. They should match. Then scroll and confirm the top offset stays at 0. Compare the sign-off block across the generated files next, and finish by extracting the text of the PDF last page.
The detail I keep returning to is the order of inspection. A manual template change has to pass in two worlds at once, a scrolling screen and a printed page, so the structure gets looked at first now. The margin numbers come later.
Sources
[4] MDN Web Docs, position
[5] MDN Web Docs, clamp()
[6] MDN Web Docs, aria-pressed
[7] Puppeteer API, Page.pdf()