/* R4: final, scoped geometry for return links and subpage headings. */
:root { --cp-sub-top:28px; --cp-sub-title:30px; --cp-sub-gap:24px; }
html body[data-cpool-controller][data-cpool-action] #cpool-main-yield > :is(.cpool-v2-page,.cpool-page,.cpool-support-page):has(.cpool-v2-back) {
  box-sizing:border-box!important; width:100%!important; max-width:none!important;
  margin:0!important; padding:var(--cp-sub-top) 0 48px!important;
}
html body[data-cpool-controller][data-cpool-action] #cpool-main-yield :is(.cpool-batch-control-page,.cpool-client-detail-page-shell-v8) > .cpool-v2-page {
  width:100%!important;max-width:none!important;margin:0!important;padding:0!important;
}
html body[data-cpool-controller][data-cpool-action] #cpool-main-yield :is(.cpool-v2-hero,.cpool-v25-section-head,.cpool-page-header,.cpool-support-hero):has(.cpool-v2-back) {
  padding:0!important;margin:0 0 var(--cp-sub-gap)!important;min-height:0!important;
  align-items:start!important;gap:20px!important;border:0!important;
}
html body[data-cpool-controller][data-cpool-action] #cpool-main-yield .cpool-document-choice-hero { display:block!important; }
html body[data-cpool-controller][data-cpool-action] :is(#cpool-main-yield,#cpool-editor-main,#cpool-document-main) .cpool-v2-back,
html body .cpool-internal-submission-back,
html body .cpool-portal-page .cpool-v2-back {
  display:block!important;width:fit-content!important;max-width:100%!important;
  min-height:20px!important;height:auto!important; padding:0!important;margin:0 0 12px!important;
  font-size:14px!important;line-height:20px!important;font-weight:650!important;
  color:#637083!important;text-decoration:none;overflow-wrap:anywhere;
}
html body[data-cpool-controller][data-cpool-action] :is(#cpool-main-yield,#cpool-editor-main,#cpool-document-main)
  :is(.cpool-v2-hero,.cpool-v25-section-head,.cpool-page-header,.cpool-support-hero):has(.cpool-v2-back) h1,
html body .cpool-portal-page .cpool-v2-panel-head h1 {
  margin:0 0 8px!important;padding:0!important;font-size:var(--cp-sub-title)!important;
  line-height:1.14!important;font-weight:800!important;letter-spacing:-.035em!important;
  overflow-wrap:anywhere;
}
html body[data-cpool-controller][data-cpool-action] #cpool-main-yield .cpool-client-hero {background:transparent!important;box-shadow:none!important;border-radius:0!important}
html body[data-cpool-controller][data-cpool-action] #cpool-main-yield .cpool-client-hero-copy {padding:0!important}
/* Settings keep a sidebar, with a common full-width heading above it. */
html body[data-cpool-controller][data-cpool-action] #cpool-main-yield > .cpool-profile-page:has(.cpool-settings-page-heading) {
  display:grid!important;grid-template-columns:230px minmax(0,1fr)!important;gap:0 32px!important;
  padding-top:var(--cp-sub-top)!important;
}
html body[data-cpool-controller][data-cpool-action] #cpool-main-yield .cpool-settings-page-heading {grid-column:1 / -1!important;}
html body[data-cpool-controller][data-cpool-action] #cpool-main-yield .cpool-profile-page:has(.cpool-settings-page-heading) > :not(.cpool-settings-page-heading) {
  width:100%!important;max-width:none!important;min-width:0!important;margin:0!important;
}
/* The PDF editor keeps its own flex viewport and editable document name. */
html body.cpool-editor-layout[data-cpool-controller][data-cpool-action] main#cpool-editor-main:has(.cpool-editor-page-heading) {
 display:flex!important;flex-direction:column!important;gap:0!important;
 margin-top:var(--cp-sub-top)!important;padding:0!important;overflow:hidden!important;
}
html body.cpool-editor-layout[data-cpool-controller][data-cpool-action] .cpool-editor-page-heading {
 flex:none!important;padding:0!important;margin:0 0 var(--cp-sub-gap)!important;background:#f5f7fb!important;
}
html body.cpool-editor-layout[data-cpool-controller][data-cpool-action] .cpool-editor-page-heading ~ .cpool-editor-workspace {
 flex:1 1 0!important;height:auto!important;min-height:0!important;
}
html body.cpool-editor-is-fullscreen .cpool-editor-page-heading {display:none!important}
html body .cpool-portal-page .cpool-v2-eyebrow {display:none!important}
html body .cpool-portal-page .cpool-v2-panel-head {align-items:start!important;gap:20px!important}
html body .cpool-portal-page .cpool-v2-panel-head > div {min-width:0}
@media(max-width:767px){
 :root {--cp-sub-top:22px;--cp-sub-title:27px;--cp-sub-gap:18px}
 html body[data-cpool-controller][data-cpool-action] #cpool-main-yield > .cpool-profile-page:has(.cpool-settings-page-heading){grid-template-columns:minmax(0,1fr)!important;gap:18px!important}
 html body[data-cpool-controller][data-cpool-action] #cpool-main-yield .cpool-client-hero {grid-template-columns:minmax(0,1fr)!important}
 html body .cpool-portal-page .cpool-v2-panel-head {flex-wrap:wrap!important}
}

html body[data-cpool-controller][data-cpool-action] .cpool-internal-submission-heading {display:block!important;min-width:0!important}
html body[data-cpool-controller][data-cpool-action] .cpool-internal-submission-divider {display:none!important}
html body[data-cpool-controller][data-cpool-action] .cpool-internal-submission-heading h1 {margin:0!important;white-space:normal!important;overflow-wrap:anywhere;font-size:var(--cp-sub-title)!important;line-height:1.14!important}

/* R8: titolo e azioni del fascicolo su righe autonome a ogni larghezza. */
html body[data-cpool-controller][data-cpool-action] #cpool-main-yield .cpool-client-hero {grid-template-columns:minmax(0,1fr)!important;gap:16px!important}
html body[data-cpool-controller][data-cpool-action] #cpool-main-yield .cpool-client-hero-actions {justify-content:flex-start!important;flex-wrap:wrap!important;min-width:0}
