/* November review: clearer hierarchy, fewer repeated blocks, larger original renders. */
#app :is(#research-essentials,#chapter-2,#chapter-13) > .section-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}
#app :is(#research-essentials,#chapter-2,#chapter-13) > .section-head > p {
  width: 100%; max-width: none; margin: 0; text-wrap: pretty;
}
#app #chapter-4 .alternative-grid {
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 24px;
}
#app #chapter-4 .alternative {
  grid-column: auto; padding: 28px 24px; min-width: 0;
  display: flex; flex-direction: column; align-items: flex-start;
  background: #f5f5f7; border: 0; border-radius: 16px;
}
#app #chapter-4 .alternative .icon {
  width: 48px; height: 56px; margin: 0 0 24px; flex: none;
}
#app #chapter-4 .alternative h4 { margin: 0 0 12px; }
#app #chapter-4 .alternative p { margin: 0; }
#app .definition-portrait { background: #f6f5f4; }
#app .internal-detail-links {
  display: flex; flex-wrap: wrap; gap: 16px 28px;
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line);
}
#app .internal-detail-links .internal-upper-detail { margin: 0; }
#app #chapter-13 .component-detail-pair {
  grid-template-columns: minmax(0,1fr); gap: 56px;
}
#app #chapter-13 .component-detail-pair .dimension-drawing img {
  width: 100%; height: auto; max-height: none; object-fit: contain;
}
#app #chapter-13 .component-detail-pair figcaption { max-width: 75ch; }
#app #stage-outcomes .stage-outcome-status { margin-top: 0; }
@media(max-width:1000px) {
  #app #chapter-4 .alternative-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:580px) {
  #app #chapter-4 .alternative-grid { grid-template-columns: minmax(0,1fr); gap: 16px; }
  #app #chapter-4 .alternative { padding: 24px; }
  #app #chapter-13 .component-detail-pair { gap: 36px; }
}

/* Give the independence statistic the full content measure. */
#app #chapter-2 .adl {
  grid-template-columns: minmax(0,1fr);
  gap: 0;
  padding-bottom: 32px;
}
#app #chapter-2 .adl > div { grid-column: 1 / -1; width: 100%; }
#app #chapter-2 .adl-heading {
  align-items: center; flex-wrap: wrap; gap: 16px 28px; margin-bottom: 24px;
}
#app #chapter-2 .adl-heading strong {
  font-size: var(--type-display) !important;
  font-weight: 600; line-height: 1.1; white-space: nowrap;
}
#app #chapter-2 .adl-heading > span { max-width: none; padding-top: 0; }
#app #chapter-2 .adl-bar { width: 100%; max-width: none; height: 20px; }
#app #chapter-2 .adl-legend {
  width: 100%; max-width: none; gap: 16px 32px; margin-top: 20px;
}
@media(max-width:580px) {
  #app #chapter-2 .adl-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
  #app #chapter-2 .adl-legend { gap: 12px 24px; }
}

/* Default-expanded final design: one heading and a tighter closing rhythm. */
#app #chapter-13 > .final-design-intro { margin-bottom: 24px; }
#app #chapter-13 > .final-design-intro + .cmf-study { margin-top: 24px; }
#app #chapter-13 .component-detail-pair figcaption,
#app #chapter-13 .component-detail-pair figcaption p {
  width: 100%; max-width: 640px;
}
#app #design > .module-content { padding-bottom: 8px; }
#app #chapter-12 #stage-outcomes { margin-bottom: 16px; }
#app #evidence { padding-top: 16px; }

/* Phone-only refinements; desktop composition and image order stay intact. */
@media (max-width: 580px) {
  #app #gripper-detail .gripper-feature-visual > svg {
    height: min(390px, 100vw);
    aspect-ratio: auto;
  }
  #app :is(#gripper-detail, #mobile-base-detail) .gripper-feature-copy > h3 {
    margin-bottom: 16px;
  }
  #app :is(#gripper-detail, #mobile-base-detail) .gripper-feature-details {
    margin: 20px 0 16px;
  }
  #app :is(#gripper-detail, #mobile-base-detail) .gripper-feature-details > div {
    padding-block: 12px;
    row-gap: 6px;
  }
  #app #head-neck-closeups .design-detail-card figcaption { padding: 20px; }
}

/* Four equal areas within the project overview content width. */
#overview .project-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 0;
  text-align: center;
}
#overview .project-facts > div {
  min-width: 0;
  padding-inline: 16px;
  grid-column: auto;
}
@media (max-width: 760px) {
  #overview .project-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 24px;
  }
  #overview .project-facts > div { padding-inline: 8px; }
}

/* Keep head and shoulder close-ups with their head-to-body overview. */
#app #head-neck-closeups { margin-top: 32px; padding: 0; isolation: auto; }
#app #head-neck-closeups::before { display: none; }
#app #head-neck-closeups .design-detail-card { background: #f5f5f7; }
