/* Final alignment and paint-cost refinements shared by every page. */
.mistake-hero-copy {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.mistake-hero-copy .mistake-hero-icon {
  display: grid;
  width: 36px;
  min-width: 36px;
  min-height: 30px;
  margin: 0;
  place-items: center;
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: normal;
}

.mistake-hero-copy > span:last-child {
  min-width: 0;
  line-height: inherit;
}

.ui-leading-emoji {
  display: inline-grid;
  width: 1.55em;
  min-width: 1.55em;
  height: 1.45em;
  margin-right: .55em;
  place-items: center;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  letter-spacing: normal;
  vertical-align: -.2em;
}

.ml-big {
  display: grid;
  grid-template-columns: 1.35em minmax(.75em, auto);
  align-items: center;
  column-gap: 15px;
  width: max-content;
  max-width: 100%;
  line-height: 1;
  letter-spacing: normal !important;
}

.ml-big-icon {
  display: inline-grid;
  width: 100%;
  min-width: 0;
  min-height: 1.12em;
  place-items: center;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-weight: 400;
  line-height: 1;
  letter-spacing: normal;
  transform: translateY(.025em);
}

.ml-big-count {
  display: block;
  min-width: .7em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
}

.errors-panel .page-hero {
  padding: 34px 28px 26px;
  border-radius: 24px;
}

.ml-tabs button,
.ml-weak h3,
.ml-section h3,
.pm-section h3,
.local-analytics-head h3 {
  line-height: 1.35;
}

.ml-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.adaptive-action {
  position: relative;
  justify-content: center !important;
  padding-right: 58px !important;
  padding-left: 58px !important;
  text-align: center;
}

.adaptive-action > .moon-mini,
.adaptive-action > .neptune-mini,
.adaptive-action > .quiz-neptune {
  position: absolute;
  left: 22px;
  margin: 0 !important;
  vertical-align: middle !important;
}

#stars,
#bgfx-layer,
.home-starfall,
.writing-aurora,
.writing-gridlines {
  contain: strict;
}

body.stellar-scrolling #stars .star,
body.stellar-scrolling #bgfx-layer .bgfx-star,
body.stellar-scrolling .home-starfall i,
body.stellar-scrolling .writing-aurora,
body.stellar-scrolling .writing-star,
body.stellar-page-hidden #stars .star,
body.stellar-page-hidden #bgfx-layer .bgfx-star,
body.stellar-page-hidden .home-starfall i,
body.stellar-page-hidden .writing-aurora,
body.stellar-page-hidden .writing-star {
  animation-play-state: paused !important;
}

/* Keep the last canvas/WebGL frame visible while their render loops rest during a fling. */
body.stellar-scrolling.stellar-render-pause #space3d,
body.stellar-scrolling.stellar-render-pause #matrix-shine,
body.stellar-scrolling.stellar-render-pause #meteors {
  visibility: visible !important;
}

/* Dictionary rows are numerous. Containment prevents a changed row from
   invalidating layout and paint for the complete 5,000+ word list. */
.vocab-page .vcat-group {
  contain: layout style paint;
}

.vocab-page .vrow {
  contain: layout style;
}

.vocab-page.stellar-scrolling .vrow,
.vocab-page.stellar-scrolling .vcat-group {
  box-shadow: none !important;
}

/* Safari can leave the animated button in a half-hidden GSAP state and can
   dispatch taps to it while visibility is transitioning. Use the CSS path. */
#fx-top {
  pointer-events: none;
  -webkit-transform: translate3d(0, 26px, 0) scale(.7);
}

#fx-top.is-on {
  pointer-events: auto;
}

#fx-top.fx-safari.fx-css {
  transition: opacity .32s, transform .32s, -webkit-transform .32s,
    box-shadow .3s, border-color .3s, visibility 0s linear .32s !important;
}

#fx-top.fx-safari.fx-css.is-on {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translate3d(0, 0, 0) scale(1) !important;
  -webkit-transform: translate3d(0, 0, 0) scale(1) !important;
  transition-delay: 0s !important;
}

body.stellar-scrolling .planet,
body.stellar-scrolling .planet *,
body.stellar-scrolling .quiz-moon,
body.stellar-scrolling .quiz-moon *,
body.stellar-scrolling .quiz-neptune,
body.stellar-scrolling .quiz-neptune *,
body.stellar-scrolling .theme-decor,
body.stellar-scrolling .theme-decor *,
body.stellar-scrolling .ml-signal,
body.stellar-scrolling #matrix-shine::before,
body.stellar-scrolling #matrix-shine::after {
  animation-play-state: paused !important;
}

/* Phone-specific containment and compositor cleanup. Immediate rendering is enforced globally below. */
@media (max-width: 760px), (max-width: 980px) and (hover: none) and (pointer: coarse) {
  #grid > .card,
  .grid,
  .tgrid,
  .grow,
  .ml-row,
  .vrow,
  .a1card,
  .tcard,
  .writing-console,
  .grammar-page .gs-card,
  body.phon-fast #view-phon .ipa-group,
  body.phon-fast #view-phon .ipa-row,
  body.phon-fast #view-phon .phon-console,
  body.phon-fast #view-phon .phon-terminal,
  body.phon-fast #view-phon .pq-card {
    content-visibility: visible !important;
    contain-intrinsic-size: none !important;
  }

  #grid > .card,
  .grow,
  .ml-row,
  .vrow,
  .a1card,
  .tcard,
  .grammar-page .gs-card,
  body.phon-fast #view-phon .ipa-group,
  body.phon-fast #view-phon .ipa-row,
  body.phon-fast #view-phon .pq-card {
    contain: layout style;
  }

  #stars .star,
  #bgfx-layer .bgfx-star,
  .home-starfall i,
  .planet,
  .quiz-moon,
  .quiz-neptune,
  .ml-signal {
    will-change: auto !important;
  }
}

@media (max-width: 520px) {
  .mistake-hero-copy {
    grid-template-columns: 33px minmax(0, 1fr);
    gap: 12px;
  }

  .mistake-hero-copy .mistake-hero-icon {
    width: 33px;
    min-width: 33px;
    font-size: 20px;
  }

  .adaptive-action {
    padding-right: 50px !important;
    padding-left: 50px !important;
  }

  .adaptive-action > .moon-mini,
  .adaptive-action > .neptune-mini,
  .adaptive-action > .quiz-neptune {
    left: 18px;
  }

  .errors-panel .page-hero {
    padding: 30px 24px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #stars .star,
  #bgfx-layer .bgfx-star,
  .home-starfall i,
  .writing-aurora,
  .writing-star {
    animation: none !important;
  }
}

/* Never postpone learning content. This also covers Android webviews whose
   viewport/pointer media queries do not reliably identify them as phones. */
@supports (content-visibility: auto) {
  html body .grid,
  html body .tgrid,
  html body #grid > .card,
  html body .grow,
  html body .ml-row,
  html body .vrow,
  html body .a1card,
  html body .tcard,
  html body .writing-console,
  html body .grammar-page .gs-card,
  html body.phon-fast #view-phon .ipa-group,
  html body.phon-fast #view-phon .ipa-row,
  html body.phon-fast #view-phon .phon-console,
  html body.phon-fast #view-phon .phon-terminal,
  html body.phon-fast #view-phon .pq-card {
    content-visibility: visible !important;
    contain-intrinsic-size: none !important;
  }
}
