/* One chapter heading above one complete reading panel, across both guide families. */
#app .cns-page[data-loophole-page] {
  --loophole-chapter-gap: 56px;
}
#app .cns-page[data-loophole-page] .cns-chapter-panel {
  display: block;
  min-width: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}
/* One gap per numbered chapter, including chapters in separate containers. */
#app .cns-page[data-loophole-page] .cns-chapter-panel.cns-chapter-following {
  margin-top: var(--loophole-chapter-gap);
  padding-top: 0;
  border-top: 0;
}
#app .cns-page[data-loophole-page="reporting"] .cns-reporting-guide-record > .cns-reporting-record-grid {
  gap: 0;
  margin-top: 0;
}
#app .cns-page[data-loophole-page] .cns-chapter-panel > .cns-chapter-heading {
  width: 100%;
  margin-bottom: 22px;
}
#app .cns-page[data-loophole-page] .cns-chapter-panel > .cns-chapter-heading > div {
  display: block;
  min-width: 0;
}
#app .cns-page[data-loophole-page] .cns-chapter-panel > .cns-chapter-body {
  display: flow-root;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 26px 28px;
  border: 1px solid #c1acf540;
  border-left: 3px solid #c1acf5;
  border-radius: 12px;
  background: linear-gradient(115deg, #c1acf510, #15151d 65%);
  overflow: visible;
}
#app .cns-page[data-loophole-page] .cns-chapter-body > :first-child { margin-top: 0; }
#app .cns-page[data-loophole-page] .cns-chapter-body > :last-child { margin-bottom: 0; }
#app .cns-page[data-loophole-page] .cns-chapter-body > .cns-chapter-intro {
  max-width: none;
  margin: 0 0 18px;
  color: #c9c1cf;
  font-size: 14px;
  line-height: 1.8;
}
#app .cns-page[data-loophole-page] .naked-shorts-page > .cns-chapter-body > :is(nav, header, section, aside) {
  min-width: 0;
  max-width: 100%;
}
/* Reporting's former page-wide record frame no longer surrounds chapter headings. */
#app .cns-page[data-loophole-page="reporting"] .cns-data-lenses > .cns-reporting-guide-record {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
/* These existing full-chapter surfaces now share the single outer panel. */
#app .cns-page[data-loophole-page] .cns-chapter-body > :is(.cns-beneficiaries-case, .cns-t1-content, .thp) {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
/* Keep the two delivery explanations together, below their chapter heading. */
#app .cns-page[data-loophole-page] .delivery-explanations > .cns-chapter-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
@media (max-width: 760px) {
  #app .cns-page[data-loophole-page] .delivery-explanations > .cns-chapter-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
}
@media (max-width: 600px) {
  #app .cns-page[data-loophole-page] { --loophole-chapter-gap: 40px; }
  #app .cns-page[data-loophole-page] .cns-chapter-panel > .cns-chapter-heading { margin-bottom: 18px; }
  #app .cns-page[data-loophole-page] .cns-chapter-panel > .cns-chapter-body { padding: 20px 16px; }
}
@media (max-width: 360px) {
  #app .cns-page[data-loophole-page] .cns-chapter-panel > .cns-chapter-body { padding: 18px 10px; }
}

/* Daily balances: keep the worked example together beside the reading copy. */
#app .cns-page .reporting-ftd-balance-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
  align-items: start;
  gap: 28px;
}
#app .cns-page .reporting-ftd-balance-copy,
#app .cns-page .reporting-ftd-balance-example { min-width: 0; }
#app .cns-page .reporting-ftd-balance-example {
  padding: 18px 20px;
  border: 1px solid #8ed7cd30;
  border-radius: 10px;
  background: #8ed7cd06;
}
#app .cns-page .reporting-ftd-balance-example .cns-volume-mixes { margin: 0 0 16px; }
#app .cns-page .reporting-ftd-balance-layout p {
  text-align: justify;
  margin: 0;
}
#app .cns-page .reporting-ftd-balance-copy p + p { margin-top: 16px; }
#app .cns-page section[aria-labelledby="cns-ftd-netting-title"] {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #8ed7cd30;
}
#app .cns-page section[aria-labelledby="cns-ftd-netting-title"] p { text-align: justify; }
#app .cns-page #cns-ftd-netting-title { margin: 0 0 16px; }
@media (max-width: 760px) {
  #app .cns-page .reporting-ftd-balance-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  #app .cns-page .reporting-ftd-balance-example { padding: 16px; }
}

#app .cns-page #naked-shorts-professional-tools .naked-shorts-locate-emphasis { color: #ff8585; }
