/* R107 critical mobile corrections.
   Loaded after the legacy bundles; keep every override scoped to small screens. */

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

@supports not (overflow: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}

@media (max-width: 960px) {
  /* The legacy desktop selector is more specific than its own mobile reset. */
  body.case-page.site-v44r22 .r22-founder-context .case-section-head {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 20px !important;
  }

  body.case-page.site-v44r22 .r22-founder-context .case-section-head > div:nth-child(2) {
    display: block !important;
  }

  body.case-page.site-v44r22 .r22-founder-context .case-section-head h2,
  body.case-page.site-v44r22 .r22-founder-context .case-section-head p {
    grid-column: auto !important;
    max-width: none !important;
  }
}

@media (max-width: 720px) {
  /* Rotate only the arrow glyph, not a full-width stretched grid cell. */
  body.case-page .m16-cycle > i,
  body.case-page .m16-quality-cycle > i {
    width: 100%;
    height: 28px;
    min-height: 28px;
    transform: none !important;
    font-size: 0 !important;
    line-height: 1 !important;
  }

  body.case-page .m16-cycle > i::before,
  body.case-page .m16-quality-cycle > i::before {
    content: "\2193";
    color: currentColor;
    font-size: 16px;
    line-height: 28px;
  }

  /* Keep the install entry point available without covering a CTA-sized area. */
  body .app-install-launcher {
    right: max(10px, env(safe-area-inset-right)) !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    min-height: 46px;
    padding: 8px !important;
    justify-content: center;
    gap: 0;
    border-radius: 50%;
  }

  body .app-install-launcher__label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  body .app-install-launcher__mark {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  /* Case evidence must remain readable without enlarging display typography. */
  body.case-page .r255-kicker,
  body.case-page .r22-founder-map > span,
  body.case-page .case-aside small {
    font-size: 12.5px !important;
    line-height: 1.45 !important;
  }

  body.case-page .r255-case-system article > b,
  body.case-page .r22-founder-flow b,
  body.case-page .m16-cycle b,
  body.case-page .m16-quality-cycle b {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  body.case-page .r255-case-system article > span,
  body.case-page .r22-founder-flow article > span,
  body.case-page .m16-cycle article > span,
  body.case-page .m16-cycle > div > span,
  body.case-page .m16-quality-cycle article > span,
  body.case-page .m16-quality-cycle > div > span {
    font-size: 13.5px !important;
    line-height: 1.5 !important;
  }

  body.case-page .r16-evidence-strip p,
  body.case-page .r16-evidence-strip a,
  body.case-page .case-related-copy p,
  body.case-page .case-related-copy b {
    font-size: 14px !important;
    line-height: 1.55 !important;
  }

  /* Publication legends, source notes and proof takeaways carry meaning, not decoration. */
  body :is(.lux-story, .lux-layout) :is(.r100-legend, .r100-takeaway),
  body .lux-source,
  body .lux-source p,
  body .lux-source a {
    font-size: 14px !important;
    line-height: 1.58 !important;
  }

  body :is(.lux-story, .lux-layout) :is(.r102-evidence, .r102-loop, .r102-boundary, .r103-case, .r103-two-paths, .r103-conditions) :is(small, article > span, li > span) {
    font-size: 12.5px !important;
    line-height: 1.45 !important;
  }
}
