/* Chapter controls are retired. The floating main menu and content filters stay. */
body[data-sar-finish] #thera-sar-editoriale :is(.atlas-reader-bar, #sar-section-dialog, .atlas-scrim),
body[data-sar-finish] :is(nav.tp-chapters, .sar-finish-section-float, .sar-finish-sections-dialog, nav.recovery-route-links) {
  display:none!important;
}

/* Use the established shared width without reserving a former index column. */
body[data-sar-finish].tp-site .tp-shell,
body[data-sar-finish].tp-site[data-sar-sections="off"] .tp-shell {
  grid-template-columns:minmax(0, 1fr);
  column-gap:0;
  max-width:var(--sar-shell-width, 1856px);
}
body[data-sar-finish].tp-site .tp-rail:empty {display:none}
body[data-sar-finish].tp-site .tp-reading {min-width:0;width:100%}
body[data-sar-finish] #thera-sar-editoriale[data-reading="continuous"] :is(.atlas-book, .atlas-reader) {
  display:block;
  grid-area:auto;
  min-width:0;
  width:100%;
  max-width:var(--sar-content-width, 1680px);
  margin-inline:auto;
  overflow:visible;
}
body[data-sar-finish] #thera-sar-editoriale[data-reading="continuous"] .atlas-reader {container:chapter / inline-size}

/* Native in-page links leave room for the existing desktop navigation. */
body[data-sar-finish] #thera-sar-editoriale .atlas-reader :is(.info-section[id], h2[id], h3[id], h4[id]),
body[data-sar-finish].tp-site :is(main[id], .tp-reading h1[id], .tp-reading h2[id], .tp-reading h3[id]) {
  scroll-margin-top:calc(var(--sar-nav-height, 108px) + 18px);
}
body[data-sar-finish][data-sar-mobile="true"] #thera-sar-editoriale .atlas-reader :is(.info-section[id], h2[id], h3[id], h4[id]),
body[data-sar-finish][data-sar-mobile="true"].tp-site :is(main[id], .tp-reading h1[id], .tp-reading h2[id], .tp-reading h3[id]) {
  scroll-margin-top:calc(22px + env(safe-area-inset-top));
}
