
/* DermPrep Idea 9.46 — Sources & page information vertical rhythm
   The Sources panel sits inside a dedicated white zone with equal space above and below. */
:root{
  --dp946-sources-edge-y:64px;
}

/* The wrapper is the spacing owner. This neutralizes older .references/.section margins. */
.sources-panel-wrap,
section.sources-panel-wrap.shell,
section.sources-panel-wrap.narrow,
section.sources-panel-wrap.references{
  width:min(920px,calc(100% - 48px))!important;
  max-width:920px!important;
  box-sizing:border-box!important;

  /* Critical: equal visual whitespace above and below the panel */
  margin-top:0!important;
  margin-bottom:0!important;
  margin-left:auto!important;
  margin-right:auto!important;
  padding-top:var(--dp946-sources-edge-y)!important;
  padding-bottom:var(--dp946-sources-edge-y)!important;
  padding-left:0!important;
  padding-right:0!important;
}

/* The actual accordion itself owns no exterior vertical margin. */
.sources-panel-wrap > .sources-panel,
.sources-panel-wrap details.sources-panel{
  margin-top:0!important;
  margin-bottom:0!important;
}

/* Preserve centered title + right-side control. */
.sources-panel summary{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  padding-left:58px!important;
  padding-right:58px!important;
}
.sources-panel-title{
  display:block!important;
  width:100%!important;
  margin:0 auto!important;
  text-align:center!important;
}
.sources-panel summary::after{
  right:18px!important;
  left:auto!important;
}
.sources-panel-body{
  text-align:left!important;
}

/* Ensure no inherited final-child margins create extra space below. */
main > .sources-panel-wrap:last-child{
  margin-bottom:0!important;
}

/* Mobile: same equal-spacing principle, slightly tighter. */
@media(max-width:640px){
  :root{
    --dp946-sources-edge-y:40px;
  }
  .sources-panel-wrap,
  section.sources-panel-wrap.shell,
  section.sources-panel-wrap.narrow,
  section.sources-panel-wrap.references{
    width:calc(100% - 32px)!important;
    max-width:none!important;
    padding-top:var(--dp946-sources-edge-y)!important;
    padding-bottom:var(--dp946-sources-edge-y)!important;
  }
  .sources-panel summary{
    padding-left:48px!important;
    padding-right:48px!important;
  }
  .sources-panel summary::after{
    right:14px!important;
  }
}
