/* Each marked phrase moves as a unit. A phrase wider than its container can
   still wrap, including with increased browser text size. */
:is([data-lofily-wrap-rule], [data-lofily-mobile-flow]) lofily-wrap.lofily-wrap-group {
  display: inline-block;
  inline-size: max-content;
  max-inline-size: 100%;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  line-break: strict;
  vertical-align: baseline;
}

/* A small number of phrases extend across an existing link or emphasis.
   Keep both pieces inline and connect them without changing the text or link. */
:is([data-lofily-wrap-rule], [data-lofily-mobile-flow]) lofily-wrap.lofily-wrap-inline {
  display: inline;
  white-space: nowrap;
}

:is([data-lofily-wrap-rule], [data-lofily-mobile-flow]) .lofily-wrap-continuation::before {
  content: "\2060";
}

@media (min-width: 801px) {
  #l6ch02 .l6ch02-hero .l6ch02-hero-main h1[data-lofily-wrap-rule="125"] {
    margin-inline-end: calc(-1 * clamp(1rem, 2.5vw, 2.5rem));
  }
}
[data-lofily-wrap-rule] > lofily-wrap-label {
  min-inline-size: 0;
  max-inline-size: 100%;
}

:is(h1, h2, h3, h4, h5, h6, p, li, figcaption)[data-lofily-wrap-rule]:lang(ja) {
  word-break: auto-phrase;
  line-break: strict;
  overflow-wrap: anywhere;
}

:is(h1, h2, h3, h4, h5, h6)[data-lofily-wrap-rule] {
  text-wrap: balance;
}

:is(p, li, figcaption)[data-lofily-wrap-rule] {
  text-wrap: pretty;
}

/* This news-card title used to be clipped to one line on phones. */
#home .home-news-card h3[data-lofily-wrap-rule="10"] {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* Fit the twelve-character part name into the space inside its own card. */
.diy-product .info-body:has(h3[data-lofily-wrap-rule="181"]) {
  container-type: inline-size;
}

.diy-product .info-body h3[data-lofily-wrap-rule="181"] {
  font-size: clamp(1rem, 8.1cqi, 1.375rem);
}

@media (max-width: 640px) {
  /* The introduction is one paragraph. Its two desktop lines can share
     the same line on narrow screens whenever the next sentence fits. */
  .vehicle-inspection-page .article-hero p.lead > .lead-line {
    display: inline;
  }
  /* The product templates also set balance/auto-phrase by ID. The compact
     mobile mode owns wrapping only on the specific copy that it has marked. */
  [data-lofily-mobile-flow] {
    word-break: normal !important;
    text-wrap: wrap !important;
    line-break: strict;
  }
  [data-lofily-mobile-flow] .l6-phrase {
    display: inline !important;
  }
  [data-lofily-mobile-flow] br[data-lofily-soft-break] {
    display: none;
  }
}

