/* A stable stage keeps native finger scrolling in control of every case. */
@media (max-width: 1100px) {
  #promise.aftercare-mobile-story {
    height: calc(var(--aftercare-viewport-height, 100svh) * 2 + var(--aftercare-travel));
  }
  #promise.aftercare-mobile-story .promise-stage {
    position: sticky;
    top: 0;
    height: var(--aftercare-visible-height, var(--aftercare-viewport-height, 100svh));
    min-height: 0;
    overflow: hidden;
  }
  #promise.aftercare-mobile-story + .creation-scene {
    margin-top: calc(-1 * var(--aftercare-viewport-height, 100svh));
  }
  #promise.aftercare-mobile-story .aftercare-layout {
    width: calc(100% - 44px);
    height: 100%;
    min-height: 0;
    padding: 82px 0 82px;
    justify-content: flex-start;
  }
  #promise.aftercare-mobile-story .aftercare-heading { flex: none; margin-bottom: 10px; }
  #promise.aftercare-mobile-story .aftercare-heading h2 { font-size: 27px; line-height: 1.35; }
  #promise.aftercare-mobile-story .aftercare-eyebrow { font-size: 12px; margin-bottom: 6px; }
  #promise.aftercare-mobile-story .aftercare-intro { display: none; }
  #promise.aftercare-mobile-story .aftercare-steps { flex: none; margin-bottom: 12px; gap: 10px; }
  #promise.aftercare-mobile-story .aftercare-steps button { min-height: 44px; padding: 7px 0; }
  #promise.aftercare-mobile-story .aftercare-steps span { font-size: 13px; }
  #promise.aftercare-mobile-story .aftercare-panels {
    position: relative;
    flex: 1;
    min-height: 0;
    display: block;
    overflow: hidden;
    isolation: isolate;
  }
  #promise.aftercare-mobile-story .aftercare-panel {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: center;
    background: #f0f1f4;
    opacity: 1;
    transform: translate3d(0, var(--case-y, 100%), 0);
    will-change: transform;
    overflow: hidden;
  }
  #promise.aftercare-mobile-story .aftercare-panel:nth-child(1) { z-index: 1; }
  #promise.aftercare-mobile-story .aftercare-panel:nth-child(2) { z-index: 2; }
  #promise.aftercare-mobile-story .aftercare-panel:nth-child(3) { z-index: 3; }
  #promise.aftercare-mobile-story .aftercare-copy h3 { font-size: 24px; line-height: 1.4; }
  #promise.aftercare-mobile-story .aftercare-context { font-size: 14px; line-height: 1.7; }
  #promise.aftercare-mobile-story .aftercare-answer strong { font-size: 16px; line-height: 1.5; }
  #promise.aftercare-mobile-story .aftercare-answer p { font-size: 14px; line-height: 1.7; }
  #promise.aftercare-mobile-story .case-evidence { align-self: center; max-height: 100%; }
  #promise.aftercare-mobile-story .case-evidence-meta { padding: 9px 12px; font-size: 11px; flex: none; }
  #promise.aftercare-mobile-story .case-evidence-image { height: 230px; min-height: 0; margin: 8px 8px 0; }
  #promise.aftercare-mobile-story .case-evidence-action { min-height: 44px; padding: 6px 12px; font-size: 12px; flex: none; }
  #promise.aftercare-mobile-story .aftercare-footer { flex: none; margin-top: 10px; gap: 16px; }
  #promise.aftercare-mobile-story .aftercare-footer p { font-size: 11px; line-height: 1.6; }
  #promise.aftercare-mobile-story .aftercare-footer a { min-height: 44px; padding: 0; font-size: 12px; }

  /* Compact screens give the full-size explanation and evidence their own holds. */
  #promise.aftercare-split-evidence .aftercare-panel { display: block; }
  #promise.aftercare-split-evidence .aftercare-copy { height: 100%; display: flex; flex-direction: column; justify-content: center; }
  #promise.aftercare-split-evidence .case-evidence {
    position: absolute;
    inset: 0;
    height: 100%;
    max-height: none;
    transform: translate3d(0, var(--case-evidence-y, 100%), 0);
    will-change: transform;
  }
  #promise.aftercare-split-evidence .case-evidence-image { flex: 1; height: auto; }
}

@media (max-width: 600px) {
  #promise.aftercare-mobile-story .aftercare-layout { width: calc(100% - 36px); padding: 78px 0 78px; }
  #promise.aftercare-mobile-story .aftercare-eyebrow { display: none; }
  #promise.aftercare-mobile-story .aftercare-heading { margin-bottom: 6px; }
  #promise.aftercare-mobile-story .aftercare-heading h2 { font-size: 22px; line-height: 1.35; }
  #promise.aftercare-mobile-story .aftercare-steps { margin-bottom: 10px; gap: 5px; }
  #promise.aftercare-mobile-story .aftercare-steps span { font-size: 12px; letter-spacing: -.06em; }
  #promise.aftercare-mobile-story .aftercare-panel { grid-template-columns: 1fr; grid-template-rows: auto minmax(140px, 1fr); align-content: center; gap: 14px; }
  #promise.aftercare-mobile-story .aftercare-case-label,
  #promise.aftercare-mobile-story .aftercare-context,
  #promise.aftercare-mobile-story .aftercare-answer > span { display: none; }
  #promise.aftercare-mobile-story .aftercare-copy h3 { font-size: 22px; line-height: 1.35; }
  #promise.aftercare-mobile-story .aftercare-answer { padding-top: 10px; margin-top: 10px; }
  #promise.aftercare-mobile-story .aftercare-answer strong { font-size: 15px; line-height: 1.45; }
  #promise.aftercare-mobile-story .aftercare-answer p { font-size: 14px; line-height: 1.65; margin-top: 6px; }
  #promise.aftercare-mobile-story .case-evidence { height: 100%; align-self: stretch; }
  #promise.aftercare-mobile-story .case-evidence-image { flex: 1; height: auto; }
  #promise.aftercare-mobile-story .aftercare-footer { flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 8px; }
  #promise.aftercare-mobile-story .aftercare-footer p { font-size: 10px; line-height: 1.5; }
  #promise.aftercare-mobile-story .aftercare-footer p br { display: none; }
  #promise.aftercare-mobile-story .aftercare-footer a { min-height: 34px; font-size: 12px; }
}

@media (max-width: 370px) {
  #promise.aftercare-mobile-story .aftercare-heading h2 { font-size: 20px; }
  #promise.aftercare-mobile-story .aftercare-copy h3 { font-size: 20px; }
  #promise.aftercare-mobile-story .aftercare-steps span { font-size: 11px; }
}

/* Keep the case itself readable when a small phone's browser toolbar opens. */
@media (max-width: 370px) and (max-height: 540px) {
  #promise.aftercare-mobile-story .aftercare-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
}

@media (max-width: 1100px) {
  #promise.aftercare-landscape-story .aftercare-layout { padding-top: 76px; padding-bottom: 76px; }
  #promise.aftercare-landscape-story .aftercare-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #promise.aftercare-landscape-story .aftercare-steps { margin-bottom: 6px; }
  #promise.aftercare-landscape-story .aftercare-copy { display: grid; grid-template-columns: .8fr 1.2fr; gap: 25px; align-items: center; }
  #promise.aftercare-landscape-story .aftercare-copy h3 { font-size: 20px; line-height: 1.35; }
  #promise.aftercare-landscape-story .aftercare-case-label,
  #promise.aftercare-landscape-story .aftercare-context,
  #promise.aftercare-landscape-story .aftercare-answer > span { display: none; }
  #promise.aftercare-landscape-story .aftercare-answer { margin: 0; padding: 0; border: 0; }
  #promise.aftercare-landscape-story .aftercare-answer strong { font-size: 15px; }
  #promise.aftercare-landscape-story .aftercare-answer p { font-size: 14px; line-height: 1.55; margin-top: 6px; }
  #promise.aftercare-landscape-story .aftercare-answer p br { display: none; }
  #promise.aftercare-landscape-story .aftercare-footer { margin-top: 6px; flex-direction: row; align-items: center; }
  #promise.aftercare-landscape-story .aftercare-footer p { font-size: 10px; line-height: 1.4; }
  #promise.aftercare-landscape-story .aftercare-footer a { min-height: 34px; }
  #promise.aftercare-landscape-story .case-evidence { display: grid; grid-template-columns: 1fr 180px; grid-template-rows: 30px 1fr; }
  #promise.aftercare-landscape-story .case-evidence-image { grid-column: 1; grid-row: 1 / -1; height: 100%; margin: 0; }
  #promise.aftercare-landscape-story .case-evidence-meta { grid-column: 2; grid-row: 1; font-size: 10px; padding: 7px 9px; }
  #promise.aftercare-landscape-story .case-evidence-action { grid-column: 2; grid-row: 2; align-self: center; }
}
