/* Narrow columns: let each script wrap at normal word boundaries. */
@media screen and (max-width: 767px) {
  html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
  html[lang] body main .wrap.bookview {
    inline-size:calc(100% - 2 * clamp(14px,4vw,26px));
    margin-inline:auto;
  }
  html[lang] body main .bookview :is(.readerbody,.chapterlead) {
    box-sizing:border-box;
    inline-size:100%;
    max-inline-size:42rem;
    margin-inline:auto;
    padding-inline:0;
  }
  html[lang][dir] body main p:not(.overline,.bookmeta,.readorigin,.history-byline,.field-help,.field-error,.booksource,[role=status],[dir]),
  html[lang][dir] body main .history .history-source > p.history-original-text {
    text-align:start;
    text-align-last:auto;
    text-wrap:wrap;
    white-space:normal;
    word-spacing:normal;
    letter-spacing:normal;
    word-break:normal;
    overflow-wrap:break-word;
  }
  html[lang] body main .bookview .readerbody > p {
    font-size:1.0625rem;
    line-height:1.78;
    max-inline-size:100%;
    margin:.85em 0;
  }
  html[dir=rtl] body main .bookview .readerbody > p {line-height:1.98;}
  html[lang] body main .bookview :is(h1,h2,h3) {
    text-align:start;
    text-wrap:wrap;
    max-inline-size:100%;
    line-height:1.5;
    overflow-wrap:break-word;
  }
  html[lang] body main .bookview .readerbody header {margin-block:1.25rem;}
  html[lang=en] body main p {hyphens:manual;-webkit-hyphens:manual;}
  html[lang=de] body main p {hyphens:auto;-webkit-hyphens:auto;}
  .bookview .scanframe:not(:has(input:checked)) .scanscroll {max-height:none;}
}

/* Continuous prose uses both edges; labels, captions, bylines and the
   last line of each paragraph retain the direction of their language. */
@media screen and (max-width: 767px) {
  html[lang][dir] body main :is(.readerbody,.chapterlead,.booklead,.history-source,.history-story,.history-research,.archive-cover-copy,.patient-view,.intl-section,.history-profile-intro,.history-topic,.bookfeature,.panel,.history-study,.history-intro,.guide,.history-founder) p:not(.overline,.bookmeta,.readorigin,.history-byline,.field-help,.field-error,.booksource,[role=status],[dir]),
  html[lang][dir] body main .history .history-source > p.history-original-text {
    text-align:justify;
    text-align-last:start;
    text-justify:auto;
    word-spacing:normal;
    white-space:normal;
    line-height:var(--reading-leading);
  }
  html[dir=rtl] body main .readerbody {--reading-leading:1.95;}
  html[dir=ltr] body main .readerbody {--reading-leading:1.72;}
  html[lang][dir] body main .bookview .readerbody > p {
    margin-block:0 1em;
    font-size:clamp(1rem,.96rem + .25vw,1.08rem);
  }
}
