/* Spacing and wrapping tuned to the four-tier type scale. */
#app :is(h2,h3,h4) { text-wrap: balance; }
#app :is(p,li,dd) { line-height: 1.65; }
#app :is(.section-head,.original-sketch-heading,.form-workbench-heading) {
  align-items: start;
  column-gap: 48px;
  row-gap: 20px;
  margin-bottom: 32px;
}
#app .section-head > h2 { max-width: none; }
#app .section-head > p { max-width: 60ch; margin: 0; }
#app :is(.eyebrow,.section-top) { margin-bottom: 16px; }
#app :is(.research-decisions,.form-decisions-grid,.stage-outcome-grid) { gap: 28px; }
#app :is(.research-decisions,.form-decision,.profile-item,.brief,.stage-outcome-grid) :is(h3,h4) { margin-bottom: 12px; }
#app .profile-item h3 { font-size: var(--type-body) !important; line-height: 1.4; font-weight: 600; }
#app .profile-item { padding-block: 24px; }
#app :is(.form-decision,.research-decisions article,.stage-outcome-grid article) { min-width: 0; }
#app .form-decision-media { margin-bottom: 20px; }
#app .cmf-layout { gap: 32px; }
#app .cmf-surfaces li { padding-block: 20px 24px; }
#app .cmf-surfaces h4 { align-items: flex-start; min-height: 2.8em; }
#app .cmf-chip { margin-top: 5px; }
#app .cmf-surfaces .cmf-spec { min-height: 3.3em; margin-bottom: 12px; }
#app .cmf-development { margin-top: 8px; }
#app :is(.component-detail-pair,.physical-model-study,.engineering-prototype,.form-workbench) { margin-top: 48px; }
#app .component-detail-pair figcaption { padding-top: 24px; }
#app .component-detail-pair h3 { margin-bottom: 16px; }
#app .module-content { padding-bottom: 32px; }
#app .module-content > .section.wrap { padding-top: 64px; }
#app .module-content > .section.wrap:first-child { padding-top: 24px; }
#app .module-collapse-row { margin-top: 24px; }
#app .narrative-extra > summary { column-gap: 24px; }
#app .narrative-extra > summary > small { max-width: 36ch; }
#app .narrative-extra-body { padding-bottom: 24px; }
#app .narrative-extra-body > .section + .section { padding-top: 56px; }
#app #stage-outcomes .stage-outcome-grid article { padding: 24px; }
#app .stage-outcome-number { margin-bottom: 16px; }
#app #stage-outcomes .text-link { display: block; margin-top: 20px; text-wrap: balance; }
#app .stage-outcome-status { align-items: flex-start; margin-top: 28px; }
#app .stage-outcome-status .stage-status { font-size: var(--type-caption) !important; line-height: 1.5; }
#app #chapter-12 { padding-block: 56px 40px; }
#app .sources { padding-block: 24px 40px; }

@media (max-width: 1100px) {
  #app .narrative-extra > summary { grid-template-columns: minmax(0,1fr) 20px; gap: 6px 16px; }
  #app .narrative-extra > summary > small { grid-column: 1; grid-row: 2; max-width: none; }
  #app .narrative-extra > summary::after { grid-column: 2; grid-row: 1 / span 2; }
  #app #stage-outcomes .stage-outcome-grid { grid-template-columns: 1fr; gap: 16px; }
  #app #stage-outcomes .stage-outcome-grid article { display: grid; grid-template-columns: minmax(180px,.8fr) minmax(0,1.4fr); column-gap: 32px; row-gap: 12px; }
  #app .stage-outcome-number { grid-column: 1; margin: 0; }
  #app #stage-outcomes .stage-outcome-grid h4 { grid-column: 1; margin: 0; align-self: start; }
  #app #stage-outcomes .stage-outcome-grid p { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  #app #stage-outcomes .stage-outcome-grid .text-link { grid-column: 2; margin: 0; text-wrap: wrap; }
  #app .stage-outcome-status { flex-direction: column; gap: 16px; }
}
@media (max-width: 800px) {
  #app :is(.section-head,.original-sketch-heading,.form-workbench-heading) { gap: 16px; margin-bottom: 28px; }
  #app .module-description { font-size: var(--type-caption) !important; line-height: 1.6; }
  #app .cmf-surfaces { grid-template-columns: 1fr; gap: 0; }
  #app .cmf-surfaces h4, #app .cmf-surfaces .cmf-spec { min-height: 0; }
  #app .cmf-surfaces h4 { margin-bottom: 8px; }
  #app .cmf-surfaces .cmf-spec { margin-bottom: 12px; }
}
@media (max-width: 580px) {
  #app :is(.section-top,.section-id) { flex-wrap: wrap; gap: 8px 16px; }
  #app .section-top { align-items: flex-start; }
  #app .section-top .tag { text-align: left; }
  #app .module-disclosure > .module-summary { grid-template-columns: 56px minmax(0,1fr) 28px; gap: 16px; padding-block: 24px; min-height: 0; }
  #app .module-thumbnail { width: 56px; height: 64px; }
  #app .module-description { margin-top: 6px; }
  #app .module-content > .section.wrap { padding-top: 44px; }
  #app .module-content > .section.wrap:first-child { padding-top: 16px; }
  #app :is(.component-detail-pair,.physical-model-study,.engineering-prototype,.form-workbench) { margin-top: 36px; }
  #app .narrative-extra { padding-inline: 20px; margin-top: 24px; }
  #app .narrative-extra > summary { padding-block: 20px; }
  #app .narrative-extra-body > .section + .section { padding-top: 40px; }
  #app #stage-outcomes .stage-outcome-grid article { display: flex; gap: 0; padding: 24px; }
  #app #stage-outcomes .stage-outcome-grid h4 { margin: 12px 0; }
  #app #stage-outcomes .stage-outcome-grid .text-link { margin-top: 16px; }
  #app #chapter-12 { padding-block: 40px 24px; }
  #app .sources { padding-block: 16px 32px; }
}
