@import url('./fonts.css');
@import url('./wallet-widget.css?v=20261202_91');
@import url('./bookmarks-panel.css?v=20261202_91');
@import url('./lesson-resume.css?v=20261202_91');
@import url('./onboarding-quiz.css?v=20261202_91');

:root {
  --ui-text: var(--heading-color, #1b1b1b);
  --ui-muted-text: #626262;
  --ui-panel: var(--light-grey);
  --ui-border: #cce9e5;
  --ui-button-text: #fff;
  --ui-page-background: var(--ui-panel);

  --radius: 8px;
  --main-yellow: #eda139;
  --main-green: #00937b;
  --light-yellow: #ffb044;
  --light-grey: #f9f6ef;
  --green-light: #00b98e;
  --gray-transcriptions: var(--ui-muted-text);
  --heading-color: #1b1b1b;
  /* --false-color: var(--lb-red); */
  --false-color: var(--scheme-wrong, #cecece);
  /* Answer correct state (profile.json schemes.prime.correct / correctLight via /brand/theme.css);
     an unset key follows the brand primary, as before the split. */
  --true-color: var(--scheme-correct, var(--main-green));
  --true-color-light: var(--scheme-correct-light, var(--green-light));
  --lb-blue: #4a8cf7;
  --lb-red: #f2546a;
  /* Lesson text scheme (profile.json schemes.prime, emitted by /brand/theme.css); built-in fallbacks. */
  --scheme-text: #000000;
  --scheme-heading: #1b1b1b;
  --scheme-muted: #6b6b6b;
  --scheme-focus: #00937b;
  --scheme-focus-light: #00b98e;
  --scheme-contrast: #eda139;
  --scheme-contrast-light: #ffb044;
  --scheme-wrong: #cecece;
  --scheme-alert: #f2546a;
  --scheme-note: #4a8cf7;
  --second-family: var(--tl-font, 'Roboto');
  --font-family: 'Roboto', var(--second-family), sans-serif;
  --learn-locale-text-scale: 1;
  --learn-locale-line-height: 1.2;
  --learn-locale-title-line-height: 1.15;
  --learn-locale-dense-text-scale: 1;
  --black: #000;

  --cell: clamp(52px, 23vmin, 90px);
  --text: #111;
  --line: var(--main-yellow);

  --gap: clamp(10px, 2.4vh, 18px);

  --screen-w: 392;
  --screen-h: 620;
  --app-scale: 1;

  --center-scale: 1;

  --fit-scale: 1;
  --h-header: 90px;
  --h-footer: 85px;
  --h-title: 110px;
  --h-row: 80px;
  --gap-row: 16px;
  --h-max-layout: 852px;
  --learner-layout-width: 393px;
  --learner-shell-width: 410px;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100dvh;
  touch-action: manipulation;
}

body {
  /* position: fixed;
  top: 0;
  left: 0; */
  overflow: hidden;
  /* Используем динамическую высоту вьюпорта */
  height: 100dvh;
  width: 100vw;
  /* display: flex;
  flex-direction: column; */
  /* margin: 0; */
  font-family: var(--font-family);
  background-color: #fff;
}

html[lang='hi'] {
  --learn-locale-text-scale: 0.94;
  --learn-locale-line-height: 1.42;
  --learn-locale-title-line-height: 1.36;
  --learn-locale-dense-text-scale: 0.92;
}

html[lang='de'] {
  --learn-locale-text-scale: 0.94;
  --learn-locale-line-height: 1.3;
  --learn-locale-title-line-height: 1.24;
  --learn-locale-dense-text-scale: 0.92;
}

html[lang='ru'] {
  --learn-locale-text-scale: 0.98;
  --learn-locale-line-height: 1.28;
  --learn-locale-title-line-height: 1.22;
}

html[lang='es'],
html[lang='fr'] {
  --learn-locale-text-scale: 0.97;
  --learn-locale-line-height: 1.28;
  --learn-locale-title-line-height: 1.22;
}

body.app-layout--fixed-phone {
  background-color: var(--ui-panel);
}

p,
h1,
h2 {
  margin: 0;
  font-weight: 400;
  font-size: inherit;
}

h1 {
  font-weight: 500;
}

button {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

a {
  -webkit-tap-highlight-color: transparent;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (orientation: landscape) {
  body {
    overflow: auto;
  }
}

/* Для устройств с "бровью" (notch) */
@supports (padding: max(0px)) {
  #app-container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .header {
    padding-top: max(1rem, env(safe-area-inset-top));
  }

  .footer {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
}

.admin__preview .footer {
  padding-left: 20px;
  padding-right: 20px;
}

.scroll-lock-ios {
  position: fixed;
  width: 100vw;
  overflow: hidden;
}

.scroll-lock {
  overflow: hidden;
}

.header {
  width: 100%;
  max-width: var(--learner-shell-width);
  margin: 0 auto;
  flex-shrink: 0;
  border-top-left-radius: 40px;
  border-top-right-radius: 40px;
  background-color: #fff;
  position: relative;
}

.footer {
  width: 100%;
  max-width: var(--learner-shell-width);
  margin: 0 auto;
  flex-shrink: 0;
  border-bottom-left-radius: 40px;
  border-bottom-right-radius: 40px;
  background-color: #fff;
}

@media (min-width: 768px) {
  .header {
    max-width: 1440px;
    display: grid;
    grid-template-columns: 1fr max-content 1fr;
    padding-top: 20px;
    /* padding-right: 53px; */
  }

  .footer {
    max-width: 984px;
  }
}

@media (min-width: 1440px) {
  .header {
    padding-top: 68px;
    /* padding-right: 53px; */
  }
}

.header__logo {
  display: none;
}

.header__nav {
  display: flex;
  justify-content: space-between;
  /* padding-top: 20px;
  padding-left: 20px;
  padding-right: 22px;
  padding-bottom: 14px; */
  /* max-width: 393px; */
  margin: 0 auto;
}

@media (min-width: 768px) {
  .header__logo {
    display: block;
  }

  .header__nav {
    position: absolute;
    top: 50px;
    right: 0;
    flex-direction: column-reverse;
    gap: 66px;
  }
}

.header__score {
  display: flex;
  align-items: center;
  gap: 5px;
}

@media (min-width: 768px) {
  .header__score {
    flex-direction: column;
    order: 2;
  }
}

.header__score span {
  display: flex;
  align-items: center;
  height: 28px;
  padding-left: 5px;
  padding-right: 5px;
  /* background-color: #faf4e4;
  border-radius: 4px;
  font-size: 15px;
  text-align: center;
  color: var(--ui-text); */
  font-weight: 900;
  font-size: 17px;
  text-align: center;
  color: var(--main-green);
}

.nav__toggle {
  display: block;
  padding: 0;
  width: 38px;
  height: 28px;
  background-color: transparent;
  background-image: url('../assets/images/system/icons/menu.svg');
  background-repeat: no-repeat;
  background-size: contain;
  border: none;
  outline: none;
  position: relative;
  z-index: 20;
  cursor: pointer;
}

.nav__toggle--return {
  background-image: none;
  color: var(--light-yellow);
}

@media (min-width: 768px) {
  .nav__toggle {
    flex-direction: column;
    order: 1;
  }
}

.nav {
  overflow: visible;
}

#courseNavigationPopupBody::-webkit-scrollbar {
  width: 6px;
}

#courseNavigationPopupBody::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background-color: var(--color-text-muted, var(--ui-muted-text));
}

@supports not selector(::-webkit-scrollbar) {
  #courseNavigationPopupBody {
    scrollbar-width: thin;
    scrollbar-color: var(--color-text-muted, var(--ui-muted-text)) transparent;
  }
}

#courseNavigationPopupBody details {
  padding: 0 29px 0 30px;
}

#courseNavigationPopupBody summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding-top: 20px;
  padding-right: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ui-border);
}

#courseNavigationPopupBody summary:has(.course-nav-progress) {
  padding-right: 106px;
}

#courseNavigationPopupBody details:first-of-type {
  position: relative;
  margin-top: 40px;
}

#courseNavigationPopupBody details:first-of-type::before {
  content: '';
  position: absolute;
  top: 0;
  left: 30px;
  right: 29px;
  display: block;
  height: 1px;
  border-top: 1px solid var(--ui-border);
}

#courseNavigationPopupBody details[open]:first-of-type::before {
  left: -30px;
  right: -30px;
}

#courseNavigationPopupBody summary::-webkit-details-marker {
  display: none;
}

#courseNavigationPopupBody summary::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  display: block;
  width: 16px;
  height: 15px;
  background-image: none;
  background-color: var(--green-light);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='21' viewBox='0 0 24 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.5501 21L0.000101044 9.44745C0.763405 8.77626 1.73762 8.39999 2.7721 8.39999C3.89697 8.39999 4.96158 8.83728 5.75501 9.6305L11.5501 15.4067L17.3452 9.64067C18.1386 8.84745 19.1932 8.41016 20.3181 8.41016C21.3525 8.41016 22.3368 8.77626 23.1001 9.45762L11.5501 21Z' fill='%2300B98E'/%3E%3Cpath d='M11.5501 12.6L0.000100924 1.04746C0.763405 0.376269 1.73762 -9.33783e-07 2.7721 -8.88565e-07C3.89697 -8.39395e-07 4.96158 0.437286 5.75501 1.23051L11.5501 7.00667L17.3452 1.24068C18.1386 0.447457 19.1932 0.0101696 20.3181 0.0101696C21.3525 0.0101696 22.3368 0.37627 23.1001 1.05763L11.5501 12.6Z' fill='%2300B98E'/%3E%3C/svg%3E%0A");
  mask-image: url("data:image/svg+xml,%3Csvg width='24' height='21' viewBox='0 0 24 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.5501 21L0.000101044 9.44745C0.763405 8.77626 1.73762 8.39999 2.7721 8.39999C3.89697 8.39999 4.96158 8.83728 5.75501 9.6305L11.5501 15.4067L17.3452 9.64067C18.1386 8.84745 19.1932 8.41016 20.3181 8.41016C21.3525 8.41016 22.3368 8.77626 23.1001 9.45762L11.5501 21Z' fill='%2300B98E'/%3E%3Cpath d='M11.5501 12.6L0.000100924 1.04746C0.763405 0.376269 1.73762 -9.33783e-07 2.7721 -8.88565e-07C3.89697 -8.39395e-07 4.96158 0.437286 5.75501 1.23051L11.5501 7.00667L17.3452 1.24068C18.1386 0.447457 19.1932 0.0101696 20.3181 0.0101696C21.3525 0.0101696 22.3368 0.37627 23.1001 1.05763L11.5501 12.6Z' fill='%2300B98E'/%3E%3C/svg%3E%0A");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  background-size: contain;
  background-repeat: no-repeat;
  transform: translateY(-50%) rotate(0);
  transition: transform 0.3s ease;
}

#courseNavigationPopupBody details[open] summary::after {
  transform: translateY(-50%) rotate(-180deg);
}

#courseNavigationPopupBody h2 {
  margin: 0;
  margin-bottom: 7px;
  font-weight: 800;
  font-size: 24px;
  color: var(--green-light);
  text-transform: uppercase;
}

#courseNavigationPopupBody h3 {
  margin: 0;
  font-weight: 500;
  font-size: 20px;
  color: var(--ui-text);
}

#courseNavigationPopupBody button {
  position: relative;
  min-height: 74px;
  margin-bottom: 54px;
  padding: 16px 20px;
  text-align: left;
  border: none;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
  z-index: 20;
}

#courseNavigationPopupBody button::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 6px 0 rgba(197, 176, 153, 0.4);
  pointer-events: none;
  z-index: -1;
}

#courseNavigationPopupBody button:has(.course-nav-progress) {
  padding-right: 92px;
}

#courseNavigationPopupBody button:has(.course-nav-lesson-complete) {
  padding-right: 64px;
}

#courseNavigationPopupBody button:first-of-type {
  margin-top: 25px;
}

#courseNavigationPopupBody button:not(:last-of-type)::before {
  pointer-events: none;
  z-index: -1;
}

#courseNavigationPopupBody button:nth-child(odd):not(:last-of-type)::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 52px;
  display: block;
  width: 68px;
  height: 75px;
  /* background-image: url("data:image/svg+xml,%3Csvg width='68' height='75' viewBox='0 0 68 75' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg filter='url(%23filter0_d_3107_3642)'%3E%3Cpath d='M15.9199 9.89502C10.92 25.895 24.9198 34.395 31.9199 36.395C38.92 38.395 52.4199 42.895 52.4199 59.895' stroke='white' stroke-width='6' stroke-dasharray='10 10'/%3E%3C/g%3E%3Cdefs%3E%3Cfilter id='filter0_d_3107_3642' x='0' y='0' width='67.4199' height='74.895' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'%3E%3CfeFlood flood-opacity='0' result='BackgroundImageFix'/%3E%3CfeColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/%3E%3CfeOffset dy='3'/%3E%3CfeGaussianBlur stdDeviation='6'/%3E%3CfeComposite in2='hardAlpha' operator='out'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.774038 0 0 0 0 0.690575 0 0 0 0 0.598391 0 0 0 0.4 0'/%3E%3CfeBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_3107_3642'/%3E%3CfeBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_3107_3642' result='shape'/%3E%3C/filter%3E%3C/defs%3E%3C/svg%3E%0A"); */
  background-image: url("data:image/svg+xml,%3Csvg width='68' height='75' viewBox='0 0 68 75' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg filter='url(%23filter0_d_758_344)'%3E%3Cpath d='M15.9201 9.89481C10.9202 25.8948 24.9201 34.3948 31.9202 36.3948C38.9203 38.3948 52.4202 42.8948 52.4202 59.8948' stroke='white' stroke-width='6' stroke-dasharray='10 10' stroke-linecap='round' /%3E%3C/g%3E%3Cdefs%3E%3Cfilter id='filter0_d_758_344' x='0' y='0' width='67.4199' height='74.8948' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'%3E%3CfeFlood flood-opacity='0' result='BackgroundImageFix' /%3E%3CfeColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha' /%3E%3CfeOffset dy='3' /%3E%3CfeGaussianBlur stdDeviation='6' /%3E%3CfeComposite in2='hardAlpha' operator='out' /%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.774038 0 0 0 0 0.690575 0 0 0 0 0.598391 0 0 0 0.4 0' /%3E%3CfeBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_758_344' /%3E%3CfeBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_758_344' result='shape' /%3E%3C/filter%3E%3C/defs%3E%3C/svg%3E%0A");
  background-repeat: no-repeat;
  background-size: cover;
}

#courseNavigationPopupBody button:nth-child(even):not(:last-of-type)::before {
  content: '';
  position: absolute;
  top: 100%;
  right: 90px;
  display: block;
  width: 68px;
  height: 75px;
  /* background-image: url("data:image/svg+xml,%3Csvg width='68' height='75' viewBox='0 0 68 75' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg filter='url(%23filter0_d_3107_3689)'%3E%3Cpath d='M51.5 9.89502C56.4999 25.895 42.5001 34.395 35.5 36.395C28.4999 38.395 15 42.895 15 59.895' stroke='white' stroke-width='6' stroke-dasharray='10 10'/%3E%3C/g%3E%3Cdefs%3E%3Cfilter id='filter0_d_3107_3689' x='0' y='0' width='67.4199' height='74.895' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'%3E%3CfeFlood flood-opacity='0' result='BackgroundImageFix'/%3E%3CfeColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/%3E%3CfeOffset dy='3'/%3E%3CfeGaussianBlur stdDeviation='6'/%3E%3CfeComposite in2='hardAlpha' operator='out'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.774038 0 0 0 0 0.690575 0 0 0 0 0.598391 0 0 0 0.4 0'/%3E%3CfeBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_3107_3689'/%3E%3CfeBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_3107_3689' result='shape'/%3E%3C/filter%3E%3C/defs%3E%3C/svg%3E%0A"); */
  background-image: url("data:image/svg+xml,%3Csvg width='68' height='75' viewBox='0 0 68 75' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg filter='url(%23filter0_d_758_351)'%3E%3Cpath d='M51.4998 9.89481C56.4997 25.8948 42.4998 34.3948 35.4997 36.3948C28.4997 38.3948 14.9998 42.8948 14.9998 59.8948' stroke='white' stroke-width='6' stroke-dasharray='10 10' stroke-linecap='round' /%3E%3C/g%3E%3Cdefs%3E%3Cfilter id='filter0_d_758_351' x='0' y='0' width='67.4199' height='74.8948' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'%3E%3CfeFlood flood-opacity='0' result='BackgroundImageFix' /%3E%3CfeColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha' /%3E%3CfeOffset dy='3' /%3E%3CfeGaussianBlur stdDeviation='6' /%3E%3CfeComposite in2='hardAlpha' operator='out' /%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.774038 0 0 0 0 0.690575 0 0 0 0 0.598391 0 0 0 0.4 0' /%3E%3CfeBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_758_351' /%3E%3CfeBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_758_351' result='shape' /%3E%3C/filter%3E%3C/defs%3E%3C/svg%3E%0A");
  background-repeat: no-repeat;
  background-size: cover;
  /* transform: scale(1, 1); */
}

#courseNavigationPopupBody button h4 {
  margin: 0 0 3px;
  font-weight: 900;
  font-size: 15px;
  color: var(--green-light);
  text-transform: uppercase;
  max-width: 100%;
  overflow-wrap: anywhere;
}

#courseNavigationPopupBody button p {
  margin: 0;
  font-weight: 500;
  font-size: 18px;
  color: var(--ui-text);
  max-width: 100%;
  overflow-wrap: anywhere;
}

#courseNavigationPopupBody button .course-nav-badge {
  position: absolute;
  right: 0;
  bottom: calc(100% + 4px);
  font-size: 15px;
  text-transform: uppercase;
  text-align: right;
  color: var(--ui-muted-text);
  display: none;
}

/* Lesson progress follows the lower edge of the card, matching the visual
   path between lessons without taking horizontal space away from titles. */
#courseNavigationPopupBody button .course-nav-lesson-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  display: block;
  height: 15px;
  overflow: hidden;
  border-radius: 8px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  background: var(--ui-border);
  pointer-events: none;
  z-index: -2;
}

#courseNavigationPopupBody button .course-nav-lesson-progress::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(10% - 1px),
    rgba(255, 255, 255, 0.28) calc(10% - 1px),
    rgba(255, 255, 255, 0.28) 10%
  );
}

#courseNavigationPopupBody button .course-nav-lesson-progress-fill {
  display: block;
  width: calc(var(--progress, 0) * 1%);
  height: 100%;
  border-radius: 0 0 0 8px;
  background: var(--green-light);
}

#courseNavigationPopupBody button:has(.course-nav-lesson-complete) .course-nav-lesson-progress-fill {
  border-bottom-right-radius: 8px;
}

#courseNavigationPopupBody button .course-nav-lesson-complete {
  position: absolute;
  top: 50%;
  right: 20px;
  width: 14px;
  height: 12px;
  background-image: none;
  background-color: var(--green-light);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='18' height='14' viewBox='0 0 18 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.2807 1.30023C10.7006 4.42399 7.23853 9.47172 5.59388 12.5614C4.46665 10.6693 3.03762 8.98708 1.2998 7.51942' stroke='%2300B98E' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
  mask-image: url("data:image/svg+xml,%3Csvg width='18' height='14' viewBox='0 0 18 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.2807 1.30023C10.7006 4.42399 7.23853 9.47172 5.59388 12.5614C4.46665 10.6693 3.03762 8.98708 1.2998 7.51942' stroke='%2300B98E' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  background-size: cover;
  background-repeat: no-repeat;
  pointer-events: none;
  transform: translateY(-50%);
}

/* Circular MC-completion style used by cumulative module progress. */
#courseNavigationPopupBody :is(button, summary) .course-nav-progress {
  --course-nav-ring-size: 52px;
  --course-nav-ring-fill: var(--green-light);
  --course-nav-ring-track: rgba(0, 0, 0, 0.08);
  --course-nav-ring-center: #fff;
  --course-nav-ring-label: var(--ui-text);
  position: absolute;
  top: 50%;
  right: 14px;
  display: grid;
  width: var(--course-nav-ring-size);
  height: var(--course-nav-ring-size);
  margin: 0;
  place-items: center;
  pointer-events: none;
  transform: translateY(-50%);
}

#courseNavigationPopupBody :is(button, summary) .course-nav-progress-ring {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(var(--course-nav-ring-fill) calc(var(--progress, 0) * 1%), var(--course-nav-ring-track) 0);
  box-shadow:
    0 8px 18px color-mix(in srgb, var(--green-light) 16%, transparent),
    inset 0 0 0 1px rgba(255, 255, 255, 0.76);
  place-items: center;
}

#courseNavigationPopupBody :is(button, summary) .course-nav-progress-ring::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--course-nav-ring-center);
  box-shadow: inset 0 1px 2px rgba(53, 37, 10, 0.08);
}

#courseNavigationPopupBody :is(button, summary) .course-nav-progress-label {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  color: var(--course-nav-ring-label);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  min-width: 0;
  text-align: center;
}

/* Module cumulative ring inside the summary row. */
#courseNavigationPopupBody summary .course-nav-progress {
  --course-nav-ring-size: 38px;
  --course-nav-ring-track: #e8e8e8;
  --course-nav-ring-fill: var(--green-light);
  right: 40px;
}

#courseNavigationPopupBody summary .course-nav-progress-ring {
  box-shadow: none;
}

#courseNavigationPopupBody summary .course-nav-progress-ring::before {
  inset: 4px;
  box-shadow: none;
}

#courseNavigationPopupBody summary .course-nav-progress-label {
  font-size: 10px;
  font-weight: 500;
}

#courseNavigationPopupBody button.is-active-lesson {
  background-color: transparent;
  width: calc(100% + 29px);
  padding-right: 54px;
}

#courseNavigationPopupBody button.is-active-lesson::after {
  border-radius: 8px 0 0 8px;
  background-color: var(--ui-current-lesson-background, var(--light-yellow));
  background-image: url('../assets/images/system/icons/course-nav-active-lesson.svg');
  background-repeat: no-repeat;
  background-position: right 30px center;
  background-size: 20px 27px;
}

/* #courseNavigationPopupBody button.is-active-lesson::before,
#courseNavigationPopupBody button:has(+ .is-active-lesson)::before {
  filter: brightness(0) invert(1);
} */

#courseNavigationPopupBody button.is-active-lesson :is(h4, p, .course-nav-badge) {
  color: var(--ui-current-lesson-text, var(--ui-button-text));
}

#courseNavigationPopupBody button.is-active-lesson .course-nav-badge {
  right: 30px;
}

#courseNavigationPopupBody button.is-active-lesson .course-nav-lesson-complete {
  display: none;
}

#courseNavigationPopupBody button.is-active-lesson .course-nav-lesson-progress {
  right: 29px;
}

#courseNavigationPopupBody details[open] {
  position: relative;
  background-color: var(--ui-panel);
  border-top: 1px solid var(--ui-border);
  border-bottom: 1px solid var(--ui-border);
  margin-top: -1px;
}

#courseNavigationPopupBody details[open]:first-of-type {
  margin-top: 39px;
}

#courseNavigationPopupBody details[open] summary {
  border-bottom-color: transparent;
}

[data-course-navigation-popup-head] {
  padding-left: 30px;
  padding-right: 16px;
}
/*
.courseNavigationPopupBody details[open]::before {
  content: '';
  position: absolute;
  top: 0;
  left: -30px;
  right: -30px;
  bottom: 0;
} */

@media (max-device-width: 375px) {
  .nav__toggle {
    width: 27px;
    height: 20px;
  }

  .header__bookmark svg {
    height: 24px;
  }

  .header__ai img {
    height: 24px;
  }

  .header__score span {
    font-size: 14px;
  }

  .header__score img {
    height: 24px;
  }
}

@media (min-width: 768px) {
  .header__bookmark {
    flex-direction: column;
    order: 3;
  }

  .header__ai {
    flex-direction: column;
    order: 4;
  }
}

#app-container {
  /* display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%; */

  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);

  /* width: calc(var(--screen-w) * 1px);
  height: calc(var(--screen-h) * 1px);

  margin: 0 auto;
  transform: scale(var(--app-scale));
  transform-origin: top center; */

  width: min(100vw, var(--learner-layout-width));
  height: 100dvh;
  margin: 0 auto;
  position: relative;
  display: grid;
  /* grid-template-rows: calc(var(--h-header) * var(--fit-scale)) minmax(0, 1fr) calc(var(--h-footer) * var(--fit-scale)); */
  grid-template-rows: var(--h-header) minmax(0, 1fr) calc(var(--h-footer) * var(--fit-scale));
  overflow: hidden;
}

@media (max-height: 500px) {
  :root {
    --h-header: 80px;
    --h-footer: 56px;
  }
}

@media (min-width: 768px) {
  #app-container {
    display: flex;
    flex-direction: column;
    height: 100%; /* Растягивается на весь body */
    width: 100%;

    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);

    /* transform: scale(var(--scale));
  transform-origin: top center; */

    transform: none;
    transform-origin: top center;
  }
}

#centralFrame {
  width: 100%;
  flex-grow: 1;
  /* overflow-y: hidden; */
  min-height: 0;
  display: block;
  position: relative;
  padding: calc(20px * var(--fit-scale)) 0 calc(40px * var(--fit-scale));
  min-height: 0;

  scrollbar-color: transparent transparent;
  scrollbar-width: thin;
}

@media (max-height: 500px) {
  #centralFrame {
    overflow-y: scroll;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (min-width: 768px) {
  #centralFrame {
    padding-top: 40px;
    padding-bottom: 20px;
  }
}

@media (min-width: 1440px) {
  #centralFrame {
    padding-top: 60px;
    padding-bottom: 80px;
  }
}

#centralFrame img,
#centralFrame video,
#centralFrame audio {
  max-width: 100%;
  height: auto;
  max-height: clamp(200px, 30vh, 240px); /* Constrain media height */
  object-fit: contain;
  margin: 0 auto;
}

.learner-live-badges {
  position: absolute;
  left: 50%;
  bottom: 13px;
  transform: translateX(-50%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: calc(100% - 32px);
  max-width: calc(100% - 32px);
  padding: 0 14px;
  pointer-events: none;
  user-select: none;
}

.learner-live-coords-badge {
  display: inline-flex;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(21, 53, 45, 0.52);
  font-size: 9px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.learner-live-carousel-badge {
  display: inline-grid;
  align-items: center;
  justify-items: center;
  gap: 1px;
  min-height: 18px;
  padding: 2px 8px;
  margin: 0 6px;
  border: 1px solid rgba(21, 53, 45, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(136, 140, 146, 0.84);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: 0.02em;
  white-space: normal;
  font-variant-numeric: tabular-nums;
  text-align: center;
  max-width: min(100%, 235px);
}

.learner-live-carousel-badge__line {
  display: block;
  white-space: nowrap;
  text-align: center;
}

.learner-live-carousel-badge[data-mode='replay'] {
  color: rgba(136, 140, 146, 0.84);
  border-color: rgba(175, 123, 33, 0.18);
  background: rgba(255, 247, 232, 0.88);
}

#centralFrame.slide-resources-pending {
  cursor: progress;
}

#centralFrame.slide-resources-pending::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  background: rgba(255, 255, 255, 0.01);
  pointer-events: auto;
}

.slide-controls__btn {
  display: block;
  padding: 0;
  background-color: transparent;
  border: none;
  outline: none;
  background-repeat: no-repeat;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 20px;
  color: var(--ui-button-text);
  /* background-color: var(--light-yellow); */
  position: relative;
  transition: all 0.5s ease;
  cursor: pointer;
  /* box-shadow: 0 3px 0 var(--main-yellow); */
  user-select: none;
}

.slide-controls__btn--prev {
  order: 1;
  /* border-radius: var(--radius); */
  width: 36px;
  height: 16px;
  background-image: url('../assets/images/system/icons/prev-new.svg');
  background-position: center;
  background-size: 22px;
  /* box-shadow: 0 3px 0 var(--main-yellow); */
}

.slide-controls__btn--next:disabled {
  background-color: color-mix(in srgb, var(--ui-button-background, var(--green-light)) 15%, transparent);
  box-shadow: none !important;
  color: var(--ui-button-background, var(--green-light));
  border: 1px dashed color-mix(in srgb, var(--ui-button-background, var(--green-light)) 41%, transparent);
  transition: none !important;
}

.slide-controls__btn--next {
  order: 2;
  border-radius: var(--radius);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding-right: 10px;
  flex-grow: 1;
  height: 45px;
  background-color: var(--ui-button-background, var(--green-light));
  background-image: none;
  background-position-y: center;
  background-position-x: 90%;
  background-size: 22px;
  box-shadow: 0 3px 0 var(--ui-button-shadow, var(--main-green));
  background-repeat: no-repeat;
}

.slide-controls__btn--skip {
  order: 3;
  /* flex-grow: 1; */
  width: 36px;
  height: 16px;
  padding: 0;
  background-image: url('../assets/images/system/icons/skip-new.svg');
  background-position: center;
}

.slide-controls__btn--prev,
.slide-controls__btn--skip {
  position: relative;
}

.slide-controls__btn--prev::after,
.slide-controls__btn--skip::after {
  content: attr(aria-label);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  color: #b4b4b4;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  display: block !important;
}

#navSame {
  display: none;
}

@media (hover: hover) {
  .slide-controls__btn--next:not(:disabled):hover {
    background-color: var(--ui-button-hover, var(--main-green));
  }
}

@media (max-device-width: 375px) {
  .slide-controls__btn {
    font-size: 16px;
    height: 36px;
  }

  .slide-controls__btn--next {
    height: 36px;
  }

  .slide-controls__btn--skip {
    height: 36px;
  }

  :root {
    --h-footer: 76px;
  }
}

@media (min-width: 768px) {
  .slide-controls__btn--next {
    width: 260px;
    padding: 0;
    justify-content: center;
  }

  .admin__preview .slide-controls__btn--prev {
    position: relative;
    background-position-x: center;
  }

  .slide-controls__btn--next,
  .slide-controls__btn--skip {
    flex-grow: 0;
  }
}

.slide-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 40px;
}

.slide {
  width: 100%;
  height: 100%;
  /* max-height: 620px; */
  display: grid;
  /* grid-template-rows: 1fr 3fr; */
  min-height: 0;

  grid-template-rows: calc(var(--h-title) * var(--fit-scale)) minmax(0, 1fr);
  row-gap: calc(var(--gap-row) * var(--fit-scale));
}

.slide,
.slide * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.slide input:not([type]),
.slide input[type='text'],
.slide input[type='search'],
.slide input[type='email'],
.slide input[type='number'],
.slide input[type='password'],
.slide input[type='tel'],
.slide input[type='url'],
.slide textarea {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

.slide__title {
  /* padding-top: 25px;
  font-size: 22px; */
  color: var(--ui-muted-text);

  min-height: 0;
  height: 100%;
  margin: 0;
  /* padding: 0 clamp(12px, calc(20px * var(--fit-scale)), 20px); */
}

.slide__title:not(.rt-richtext) {
  text-align: center;
  font-size: clamp(14px, calc(24px * var(--fit-scale) * var(--learn-locale-text-scale)), 24px);
  line-height: var(--learn-locale-title-line-height);
  overflow-wrap: anywhere;
  word-break: normal;
}

/* I-0 (authoring-only) marker: rendered in the editor/preview only. */
.slide--authoring-only {
  position: relative;
}

.slide__authoring-badge {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 2px 10px;
  border: 1px dashed #d9b85c;
  border-radius: 999px;
  background: #fff4d6;
  color: #8a6d1f;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.slide__title--vertical-centered {
  grid-row: 1 / -1;
  margin: auto;
  padding-top: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 768px) {
  .slide__title {
    width: 100%;
    max-width: 867px;
    margin: 0 auto;
  }
}

.slide__compare {
  display: flex;
  justify-content: center;
  gap: calc(var(--gap-row) * var(--fit-scale));
  grid-row: 2 / 5;
}

.slide__compare:has(+ .slide__symbol-transcription) {
  grid-row: 2 / 4;
}

.slide__compare-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 110px;
  width: calc(100% / 3);
  max-width: 110px;
  row-gap: calc(var(--gap-row) * var(--fit-scale));
}

.slide__compare-item .slide__symbol-transcription {
  margin-bottom: 10px;
  padding: 0;
}

.slide__compare-card {
  position: relative;
  display: grid;
  grid-template-rows: calc(var(--h-row) * var(--fit-scale) + var(--gap-row) * var(--fit-scale)) 1fr;
  width: 100%;
  min-height: calc(var(--h-row) * 2 * var(--fit-scale) - 20px);
  /* height: calc((var(--h-row) * var(--fit-scale)) * 2 + calc(var(--gap-row) * var(--fit-scale))); */
  /* margin-bottom: 33px; */
  background-color: var(--ui-panel);
  border-radius: 8px;
  border-radius: calc(var(--radius) * var(--fit-scale));
  overflow: hidden;
  font-weight: 500;
  font-size: 20px;
  text-align: center;
  color: var(--dark-green);
}

.slide__cards .slide__compare-card {
  margin-bottom: 0;
}

.slide__compare-card--symbol {
  display: flex;
  justify-content: center;
  align-items: center;
}

.slide__compare-card--symbol:not(.rt-richtext) {
  font-family: var(--second-family);
  font-size: 60px;
  font-size: clamp(32px, calc(60px * var(--fit-scale)), 60px);
  font-weight: 400;
  line-height: 2;
  line-height: calc(var(--h-row) * var(--fit-scale));
}

.slide__compare-symbol + [data-field]:not(.rt-richtext) {
  font-size: clamp(12px, calc(20px * var(--fit-scale)), 20px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding-bottom: 5px;
}

/* .slide__compare-card span {
  grid-row: 2 / 3;
  margin: auto;
} */

.slide__compare-symbol {
  display: flex;
  justify-content: center;
  align-items: center;
}

.slide__compare-symbol:not(.rt-richtext) {
  font-size: clamp(32px, calc(64px * var(--fit-scale)), 64px);
  font-family: var(--second-family);
  direction: var(--tl-dir, rtl);
  font-weight: 400;
  text-align: center;
  line-height: calc(var(--h-row) * var(--fit-scale));
}

.slide--i-10 .slide__compare-card {
  direction: inherit;
  font-weight: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: inherit;
  color: inherit;
}

.slide--i-10 .slide__content > [data-field='ar.v_1'] {
  transform: translateY(calc(-1 * (var(--h-row) + var(--gap-row)) * var(--fit-scale)));
}

.slide--i-10 .slide__symbol:not(.rt-richtext),
.slide--i-10 .slide__symbol--large:not(.rt-richtext),
.slide--i-10 .slide__compare-card--symbol:not(.rt-richtext),
.slide--i-10 .slide__compare-symbol:not(.rt-richtext),
.slide--i-10 .slide__compare-symbol + [data-field]:not(.rt-richtext) {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: inherit;
  color: inherit;
  direction: inherit;
}

.slide--i-10 .slide__compare-symbol + [data-field]:not(.rt-richtext) {
  padding-bottom: 0;
}

/* @media (max-device-width: 375px) {
  .slide__compare-item {
    width: 85px;
  }

  .slide__compare-card {
    width: 85px;
    height: 130px;
  }

  .slide__compare-card span {
    font-size: 16px;
  }

  .slide__compare-card-symbol {
    font-size: 44px;
  }

  .slide__compare-card-symbol span {
    font-size: 44px;
  }
} */

.play-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 64px;
  height: 64px;
  width: clamp(48px, calc(64px * var(--fit-scale)), 64px);
  height: clamp(48px, calc(64px * var(--fit-scale)), 64px);
  padding: 0;
  background-color: #fff;
  box-shadow: 0 3px 12px 0 rgba(197, 176, 153, 0.4);
  border-radius: 100%;
  border: none;
}

.play-btn.playing {
  box-shadow: none !important;
}

.play-btn.disabled svg path {
  fill: #e7e7e7 !important;
  pointer-events: none;
}

.slide__audio-btn {
  box-shadow: 0 3px 12px 0 rgba(197, 176, 153, 0.4) !important;
}

.slide__audio-btn svg {
  height: 100%;
  max-height: 50%;
  width: auto;
}

.slide__audio-btn--small {
  /* width: 48px !important;
  height: 48px !important; */
  width: clamp(32px, calc(48px * var(--fit-scale)), 48px);
  height: clamp(32px, calc(48px * var(--fit-scale)), 48px);
}

.slide__audio-btn--large {
  width: clamp(32px, calc(80px * var(--fit-scale)), 80px);
  height: clamp(32px, calc(80px * var(--fit-scale)), 80px);
}

.slide__audio-btn--center {
  margin: auto;
}

.slide__audio-btn--mt-0 {
  margin-top: 0;
}

/* @media (max-device-width: 375px) {
  .slide__audio-btn--small {
    width: 36px !important;
    height: 36px !important;
    box-shadow: 0 3px 12px 0 rgba(197, 176, 153, 0.4) !important;
  }

  .slide__audio-btn--small svg {
    width: 18px;
    height: 19px;
  }
} */

.slide__symbol {
  grid-row: 1 / 2;
  position: relative;
  z-index: 2;
}

.slide__symbol:not(.rt-richtext) {
  font-family: var(--second-family);
  font-weight: 400;
  font-size: 60px;
  font-size: clamp(36px, calc(60px * var(--fit-scale)), 60px);
  line-height: 1.33;
  line-height: calc(var(--h-row) * var(--fit-scale));
  text-align: center;
  color: #000;
  direction: var(--tl-dir, rtl);
}

.exact-match {
  color: var(--true-color);
}

.quasi-match {
  color: var(--main-yellow);
}

.no-match {
  color: var(--lb-red);
}

.slide__symbol--small:not(.rt-richtext) {
  font-size: clamp(20px, calc(36px * var(--fit-scale)), 36px);
}

.slide__content > .slide__symbol {
  /* display: flex;
  justify-content: center;
  align-items: center; */
}

.slide__symbol-transcription {
  margin-top: auto;
  /* margin-bottom: 25px; */
}

.slide__symbol-transcription:not(.rt-richtext) {
  font-weight: 500;
  font-size: 24px;
  font-size: clamp(16px, calc(24px * var(--fit-scale)), 24px);
  text-align: center;
  color: var(--gray-transcriptions);
}

.slide__symbol-transcription .slide__audio-btn {
  margin-top: 5px;
}

.slide__symbol--large:not(.rt-richtext) {
  font-size: 80px;
  font-size: clamp(60px, calc(80px * var(--fit-scale)), 80px);
}

.slide__content {
  --slide-content-rows-sum: 5;
  --slide-content-row-1-weight: 1;
  --slide-content-row-2-weight: 1;
  --slide-content-row-3-weight: 1;
  --slide-content-row-4-weight: 1;
  --slide-content-row-5-weight: 1;
  --slide-content-offset-y: 0px;
  min-height: 0;
  width: 100%;
  max-width: 410px;
  margin: 0 auto;
  display: grid;
  /* grid-template-rows: 78px repeat(4, minmax(0, 1fr)); */
  /* grid-template-rows: repeat(5, calc(var(--h-row) * var(--fit-scale))); */
  grid-template-rows:
    minmax(
      calc((var(--h-row) * 5 * var(--fit-scale) * var(--slide-content-row-1-weight)) / var(--slide-content-rows-sum)),
      auto
    )
    calc((var(--h-row) * 5 * var(--fit-scale) * var(--slide-content-row-2-weight)) / var(--slide-content-rows-sum))
    calc((var(--h-row) * 5 * var(--fit-scale) * var(--slide-content-row-3-weight)) / var(--slide-content-rows-sum))
    calc((var(--h-row) * 5 * var(--fit-scale) * var(--slide-content-row-4-weight)) / var(--slide-content-rows-sum))
    calc((var(--h-row) * 5 * var(--fit-scale) * var(--slide-content-row-5-weight)) / var(--slide-content-rows-sum));

  /* row-gap: 3.5%; */
  /* row-gap: var(--gap); */
  row-gap: calc(var(--gap-row) * var(--fit-scale));
  transform: translateY(var(--slide-content-offset-y));
  /* overflow-y: auto;
  -webkit-overflow-scrolling: touch; */
}

.slide--i-6 .slide__content {
  grid-template-rows: minmax(0, 1fr);
  row-gap: 0;
}
/*
.slide--c4 .slide__content {
  grid-template-rows: repeat(5, calc(var(--h-row) * var(--fit-scale)));
} */

.slide__content .slide__title {
  margin: 0;
  padding: 0;
  grid-row: 1 / 3;
  color: inherit;
}

.slide__content .slide__title:not(.rt-richtext) {
  font-weight: 500;
  font-size: 30px;
  font-size: clamp(20px, calc(30px * var(--fit-scale)), 30px);
  text-align: center;
}

@media (max-width: 375px) {
  .slide__content .slide__title:not(.rt-richtext) {
    font-size: 24px;
  }
}

.slide__content:has(.slide__text-content) {
  display: flex;
  flex-direction: column;
}

/* @media (max-device-width: 375px) {
  .slide__content {
    display: grid;
    grid-template-rows: 66px repeat(4, auto);
    row-gap: 3.5%;
  }
} */

.slide__vertical-full-wrapper {
  grid-row: 3 / -1;
  display: grid;
  grid-template-rows: repeat(3, calc(var(--h-row) * var(--fit-scale)));
  row-gap: calc(var(--gap-row) * var(--fit-scale));
}

.slide__with-pic {
  grid-row: 2 / -1;
  display: grid;
  grid-template-rows: repeat(3, calc(var(--h-row) * var(--fit-scale)));
  row-gap: calc(var(--gap-row) * var(--fit-scale));
}

.slide__with-pic .slide__pic-with-icon {
  grid-row: 2 / 4;
}

.slide__with-pic .slide__pic-with-icon img {
  height: 100% !important;
  width: auto;
}

.slide__with-pic .slide__symbol-transcription {
  margin-bottom: 0;
}

.slide__with-pic .slide__audio-btn {
  grid-row: 4 / -1;
}

.slide__with-pic .slide__vertical-full-wrapper .slide__audio-btn {
  grid-row: 3 / -1;
}

.video-player {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  grid-row: 1 / -1;
}

.video-player__video {
  /* width: 100%; */
  min-height: 188px;
}

.video-player__controls {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  margin: auto 0;
}

.video-player__play-btn {
  display: block;
  width: 72px;
  height: 72px;
  padding: 0;
  border: none;
  cursor: pointer;
  background-color: transparent;
}

/* Media controls stay left-to-right whatever the learning language: the slide root is
   stamped with the taught language direction (stampLearningLanguage), which would mirror
   the play button and run the range input right-to-left against its WebKit fill trick. */
.video-player,
.video-player__controls {
  direction: ltr;
}

.video-player__progress {
  -webkit-appearance: none;
  appearance: none;
  /* width: 100%; */
  flex-grow: 1;
  height: 6px;
  border-radius: 3px;
  background: #e5e5e5; /* серая линия фона */
  outline: none;
  overflow: hidden;
  cursor: pointer;
}

/* Зелёная заливка прогресса */
.video-player__progress::-webkit-slider-runnable-track {
  height: 6px;
  background: #e5e5e5;
  border-radius: 3px;
}

.video-player__progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 0; /* убираем кружок */
  height: 4px;
  box-shadow: -1000px 0 0 1000px var(--green-light); /* заливка до ползунка */
  border: none;
}

/* Для Firefox */
.video-player__progress::-moz-range-track {
  height: 4cqh;
  background: #e5e5e5;
  border-radius: 2px;
}

.video-player__progress::-moz-range-progress {
  height: 4px;
  background: var(--green-light);
  border-radius: 2px;
}

.video-player__progress::-moz-range-thumb {
  width: 0;
  height: 4px;
  border: none;
}

/* @media (max-device-width: 375px) {
  .video-player__play-btn {
    width: 66px;
    height: 66px;
  }

  .video-player__play-btn svg {
    width: 100%;
    height: auto;
  }
} */

.slide__letters-grid {
  grid-row: 2 / -1;
  display: grid;
  grid-template-columns: repeat(4, calc(90px * var(--fit-scale)));
  grid-auto-rows: calc(var(--h-row) * 0.91 * var(--fit-scale));
  gap: 0;
  border: 1px solid var(--line);
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
  align-self: start;
}

/* @media (max-width: 392px) {
  :root {
    --cell: clamp(40px, 18vmin, 80px);
  }
}

@media (max-device-width: 375px) {
  :root {
    --cell: clamp(52px, 17vmin, 90px);
  }
} */

.slide__letters-grid-btn {
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  font-size: clamp(28px, 8.5vmin, 40px);
  line-height: 1;
  cursor: pointer;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  color: var(--black);
  position: relative;
  isolation: isolate;

  /* display: flex;
  justify-content: center;
  align-items: center;
  width: 81px;
  height: 70px;
  margin-top: -1px;
  font-family: var(--second-family);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.2;
  text-align: center;
  color: #000;
  border: 1px solid var(--main-yellow);
  background-color: transparent; */
  /* margin-left: -1px; */
}

.slide__letters-grid-btn::before {
  content: '';
  position: absolute;
  inset: 2px;
  background: transparent;
  opacity: 0;
  transition:
    background-color 0.25s ease,
    opacity 0.25s ease;
  z-index: 0;
}

.slide__letters-grid-text {
  display: block;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* .slide__letters-grid-btn:nth-child(4n + 4) {
  border-right: none;
}

.slide__letters-grid-btn:nth-last-child(-n + 5) {
  border-bottom: none;
} */

.slide__letters-grid-btn.correct {
  color: var(--ui-button-text);
  transition: color 0.25s ease;
}

.slide__letters-grid-btn.wrong {
  color: var(--ui-muted-text);
  transition: color 0.25s ease;
}

.slide__letters-grid-btn.correct::before {
  background-color: var(--true-color);
  opacity: 1;
}

.slide__letters-grid-btn.wrong::before {
  background-color: #ececec;
  opacity: 1;
}

.slide__word-search-words {
  grid-row: 1 / 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: calc(4px * var(--fit-scale)) calc(14px * var(--fit-scale));
  min-height: 0;
  font-family: var(--second-family);
  font-size: clamp(18px, calc(26px * var(--fit-scale)), 26px);
  line-height: 1.3;
  color: #000;
}

.slide__word-search-word {
  transition:
    color 0.25s ease,
    opacity 0.25s ease;
}

.slide__word-search-word.found {
  color: var(--true-color);
  opacity: 0.6;
  text-decoration: line-through;
}

.slide__word-search {
  --word-search-size: 6;
  grid-row: 2 / -1;
  display: grid;
  grid-template-columns: repeat(var(--word-search-size), minmax(0, 1fr));
  grid-template-rows: repeat(var(--word-search-size), minmax(0, 1fr));
  /* Cell coordinates are physical (x grows to the right) for every script. */
  direction: ltr;
  gap: 0;
  height: 100%;
  max-height: calc(var(--h-row) * 4 * var(--fit-scale));
  aspect-ratio: 1;
  max-width: 100%;
  margin: 0 auto;
  align-self: start;
  border: 1px solid var(--line);
  touch-action: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.slide__word-search-cell {
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  font-size: clamp(15px, calc(var(--h-row) * 4 * var(--fit-scale) / var(--word-search-size) * 0.58), 40px);
  line-height: 1;
  color: var(--black);
  position: relative;
  isolation: isolate;
}

.slide__word-search-cell::before {
  content: '';
  position: absolute;
  inset: 2px;
  background: transparent;
  opacity: 0;
  transition:
    background-color 0.25s ease,
    opacity 0.25s ease;
  z-index: 0;
}

.slide__word-search-text {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.slide__word-search-cell.selected::before {
  background-color: var(--line);
  opacity: 0.45;
  transition: none;
}

.slide__word-search-cell.correct {
  color: #fff;
  transition: color 0.25s ease;
}

.slide__word-search-cell.correct::before {
  background-color: var(--true-color);
  opacity: 1;
}

.slide__word-search-cell.correct.selected::before {
  opacity: 0.7;
}

.slide__word-search-cell.wrong {
  color: var(--ui-muted-text);
  transition: color 0.25s ease;
}

.slide__word-search-cell.wrong:not(.correct)::before {
  background-color: #ececec;
  opacity: 1;
}

.slide__word-search.is-complete {
  cursor: default;
}

.slide__input-wrapper {
  grid-row: 2 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-top: 30px;
  background-color: var(--ui-panel);
  border-radius: var(--radius);
}

.play-btn + .slide__input-wrapper {
  margin-top: 28px;
}

.slide--tp .slide__input-wrapper--keyboard-open {
  align-self: start;
  width: 100%;
}

.slide__input {
  border: 1px solid #b6b6b6;
  border-radius: var(--radius);
  width: 100%;
  max-width: 296px;
  height: 46px;
  background: #fff;
  font-family: var(--font-family);
  font-weight: 400;
  font-size: 26px;
  font-size: clamp(16px, calc(26px * var(--fit-scale)), 26px);
  text-align: center;
  color: #000;
  outline: none;
}

.slide--tp .slide__input {
  direction: var(--tl-dir, rtl);
  font-family: var(--second-family);
}

.slide__input:active,
.slide__input:focus {
  border-color: #5a5a5a;
}

.slide__input.wrong {
  border-color: var(--false-color);
}

.slide--tp .slide__input.wrong {
  animation: tp-input-wrong-shake 0.34s ease;
  box-shadow: 0 0 0 2px rgba(248, 59, 60, 0.14);
}

.slide__input.correct {
  border-color: var(--true-color-light);
}

.slide__input + .slide__check-btn {
  max-width: 160px;
}

.slide--tp .slide__check-btn {
  max-width: 160px;
  max-height: 50px;
  text-transform: uppercase;
}

@keyframes tp-input-wrong-shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px);
  }

  50% {
    transform: translateX(4px);
  }

  75% {
    transform: translateX(-2px);
  }
}

.tp-keyboard {
  --tp-keyboard-gap: clamp(3px, calc(5px * var(--fit-scale)), 5px);
  --tp-keyboard-key-height: clamp(32px, calc(43px * var(--fit-scale)), 43px);
  /* --tp-cols = widest row of the current layout (set by TP-1/initialize.js). */
  --tp-cols: 11;
  --tp-key-width: calc((100% - (var(--tp-cols) - 1) * var(--tp-keyboard-gap)) / var(--tp-cols));
  width: 100%;
  box-sizing: border-box;
  margin-bottom: clamp(10px, calc(14px * var(--fit-scale)), 14px);
  padding: clamp(5px, calc(7px * var(--fit-scale)), 7px);
  border-radius: 8px;
  background: var(--ui-panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  direction: ltr;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.tp-keyboard[hidden] {
  display: none;
}

.tp-keyboard__row {
  display: flex;
  justify-content: center;
  gap: var(--tp-keyboard-gap);
  margin-bottom: var(--tp-keyboard-gap);
}

.tp-keyboard__row:last-child {
  margin-bottom: 0;
}

/* The service row (punctuation, space, Go) fills the width by key weight. */
.tp-keyboard__row--service .tp-keyboard__key {
  flex: var(--tp-key-units, 1) 1 0;
}

/* Letter and digit keys share one width across rows; a key with --tp-key-units > 1
   spans that many key slots plus the gaps between them, shorter rows are centred. */
.tp-keyboard__key {
  position: relative;
  flex: 0 0 calc(var(--tp-key-units, 1) * var(--tp-key-width) + (var(--tp-key-units, 1) - 1) * var(--tp-keyboard-gap));
  min-width: 0;
  height: var(--tp-keyboard-key-height);
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 1px 2px rgba(0, 0, 0, 0.18);
  color: #111;
  cursor: pointer;
  font-family: var(--second-family);
  font-size: clamp(18px, calc(20px * var(--fit-scale)), 20px);
  font-weight: 400;
  line-height: 1;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

.tp-keyboard__key:active,
.tp-keyboard__key.is-pressed {
  background: #f5f7fa;
  transform: translateY(1px);
}

.tp-keyboard__key--service,
.tp-keyboard__key--go {
  background: #ebe8e3;
  color: var(--ui-text);
  font-family: var(--font-family);
  font-size: clamp(14px, calc(18px * var(--fit-scale)), 18px);
  font-weight: 500;
}

.tp-keyboard__key--go {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='800px' height='800px' viewBox='0 0 24 24' version='1.1' data-google-analytics-opt-out=''%3E%3C!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools --%3E%3Ctitle%3Eic_fluent_arrow_enter_24_filled%3C/title%3E%3Cdesc%3ECreated with Sketch.%3C/desc%3E%3Cg id='🔍-System-Icons' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='ic_fluent_arrow_enter_24_filled' fill='%23212121' fill-rule='nonzero'%3E%3Cpath d='M21,4 C21.5128358,4 21.9355072,4.38604019 21.9932723,4.88337887 L22,5 L22,11.5 C22,13.3685634 20.5357224,14.8951264 18.6920352,14.9948211 L18.5,15 L5.415,15 L8.70710678,18.2928932 C9.06759074,18.6533772 9.09532028,19.2206082 8.79029539,19.6128994 L8.70710678,19.7071068 C8.34662282,20.0675907 7.77939176,20.0953203 7.38710056,19.7902954 L7.29289322,19.7071068 L2.29289322,14.7071068 C2.25749917,14.6717127 2.22531295,14.6343256 2.19633458,14.5953066 L2.12467117,14.4840621 L2.12467117,14.4840621 L2.07122549,14.371336 L2.07122549,14.371336 L2.03584514,14.265993 L2.03584514,14.265993 L2.0110178,14.1484669 L2.0110178,14.1484669 L2.00397748,14.0898018 L2.00397748,14.0898018 L2,14 L2.00278786,13.9247615 L2.00278786,13.9247615 L2.02024007,13.7992742 L2.02024007,13.7992742 L2.04973809,13.6878575 L2.04973809,13.6878575 L2.09367336,13.5767785 L2.09367336,13.5767785 L2.14599545,13.4792912 L2.14599545,13.4792912 L2.20970461,13.3871006 L2.20970461,13.3871006 L2.29289322,13.2928932 L2.29289322,13.2928932 L7.29289322,8.29289322 C7.68341751,7.90236893 8.31658249,7.90236893 8.70710678,8.29289322 C9.06759074,8.65337718 9.09532028,9.22060824 8.79029539,9.61289944 L8.70710678,9.70710678 L5.415,13 L18.5,13 C19.2796961,13 19.9204487,12.4051119 19.9931334,11.64446 L20,11.5 L20,5 C20,4.44771525 20.4477153,4 21,4 Z' id='🎨-Color'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  font-size: 0;
  background-position: center;
  background-size: 50%;
}

.tp-keyboard__key--space {
  font-size: clamp(12px, calc(16px * var(--fit-scale)), 16px);
}

.tp-keyboard__key--punctuation {
  font-size: clamp(18px, calc(24px * var(--fit-scale)), 24px);
}

.tp-keyboard__variants {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  z-index: 12;
  display: flex;
  min-width: calc(var(--tp-keyboard-key-height) * 3.1);
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.24);
  transform: translateX(-50%);
}

.tp-keyboard__variant {
  width: calc(var(--tp-keyboard-key-height) * 1.06);
  height: calc(var(--tp-keyboard-key-height) * 1.36);
  padding: 0;
  border: 0;
  background: #fff;
  color: #111;
  font-family: var(--second-family);
  font-size: clamp(22px, calc(30px * var(--fit-scale)), 30px);
  line-height: 1;
  text-align: center;
}

.tp-keyboard__variant.is-active {
  background: var(--lb-blue);
  color: #fff;
}

.slide__check-btn,
.v8-answer {
  width: 100%;
  height: calc(var(--h-row) * var(--fit-scale));
  box-shadow: 0 3px 12px 0 rgba(197, 176, 153, 0.4);
  background: #fff;
  border-radius: 12px;
  border-radius: calc(12px * var(--fit-scale));
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: grab;
  transition: background 0.3s;
  font-family: var(--second-family), 'Roboto', sans-serif;
  font-weight: 700;
  font-size: clamp(14px, calc(20px * var(--fit-scale)), 20px);
  line-height: 1.8;
  color: var(--black);
  border: 1px solid transparent;
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.v8-answer {
  width: 100%;
  max-width: unset;
}

.v8-answer.correct {
  color: var(--true-color-light);
  border: 2px solid var(--true-color-light);
  box-shadow: none;
  pointer-events: none;
}

.v8-answer.wrong {
  color: var(--false-color);
  border: 2px solid var(--false-color);
  animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.v8-letter.locked {
  display: none;
}

/* @media (max-device-width: 375px) {
  .slide__check-btn,
  .v8-answer {
    height: 60px;
  }

  .v8-answer {
    font-size: 17px;
  }
} */

.v8-game-area {
  grid-row: 1 / 4;
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 245px;
  border-radius: 8px;
  border-radius: calc(var(--radius) * var(--fit-scale));
  overflow: hidden;
  background-color: var(--ui-panel);
}

.v8-letter {
  position: absolute;
  top: 0;
  transform-origin: center top;
  box-sizing: border-box;
  width: max-content;
  max-width: calc(100% - 32px);
  padding-inline: 0.12em;
  /* Safari clips ink outside the moving layer. A kasra below ح needs extra descent. */
  padding-block: 0.25em 0.5em;
  direction: var(--tl-dir, rtl);
  font-family: var(--second-family);
  font-weight: 400;
  font-size: 70px;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  color: #000;
}

.v8-answers {
  grid-row: 4 / -1;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--gap-row) * var(--fit-scale));
  align-items: start;
  align-self: start;
}

.slide__var {
  margin: 0 auto;
}

.slide__var:not(.rt-richtext) {
  font-weight: 500;
  font-size: 54px;
  font-size: clamp(32px, calc(54px * var(--fit-scale)), 54px);
  line-height: 1.16;
  text-align: center;
  color: var(--black);
}

/* @media (max-device-width: 375px) {
  .slide__var {
    font-size: 36px;
  }
} */

.slide__answers-list {
  grid-row: 3 / 5;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(2, calc(var(--h-row) * var(--fit-scale)));
  /* column-gap: 10%;
  gap: var(--gap); */
  gap: calc(var(--gap-row) * var(--fit-scale));
  height: fit-content;
}

.slide__answers-list:has(li:nth-child(2)):not(:has(li:nth-child(4))) {
  display: grid;
  grid-template-columns: 1fr;
  grid-row: 2 / -1;
  grid-template-rows: repeat(3, calc(var(--h-row) * var(--fit-scale)));
  margin-top: auto;
}

.slide__answers-list:has(li:nth-child(2)):not(:has(li:nth-child(3))) {
  grid-template-columns: 1fr 1fr;
}

.slide__answers-list:has(li:nth-of-type(3)) .slide__answer-btn {
  height: 100%;
}

.slide__answers-list:has(li:nth-of-type(4)) {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(2, calc(var(--h-row) * var(--fit-scale)));
  grid-row: 3 / -1;
}

.slide__answers-list:has(li .slide__answer-btn--long) {
  grid-row: 2 / -1;
}

.slide__answers-list li {
  height: 100%;
}

.slide__answers-list--full {
  display: flex !important;
  flex-direction: column !important;
  width: 100%;
  /* margin-top: auto; */
  margin: auto;
  gap: var(--gap);
  gap: calc(var(--gap-row) * var(--fit-scale));
  grid-row: 1 / -1;
}

.slide__symbol:has(+ .slide__answers-list--full) {
  grid-row: 1 / 3;
}

.slide__symbol + .slide__answers-list--full {
  grid-row: 3 / -1 !important;
}

.slide__symbol:has(.slide__audio-btn) {
  display: flex;
  justify-content: center;
  align-items: center;
}

.slide__answers-list--vertical-centered {
  margin: auto;
}

.slide__answers-list--flex {
  display: flex;
  width: 100%;
}

.slide__answers-list {
  width: 100%;
}

.slide--a-5 .slide__answers-list {
  grid-row: 4 / 6;
}

.slide--a-1 .slide__answers-list--flex {
  justify-content: center;
  align-items: center;
}

.slide--a-1 .slide__answers-list--flex li {
  width: auto;
  flex: 0 1 33.3%;
}

.slide__answers-list--flex li {
  width: 33.3%;
}

.slide__answers-list--single-choice-centered {
  display: grid !important;
  grid-template-columns: minmax(0, min(50%, 420px));
  justify-content: center;
  align-content: center;
}

.slide__answers-list--single-choice-centered > * {
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
}

.slide__answer-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  /* height: 80px; */
  height: clamp(100%, calc(80px * var(--fit-scale)), 80px);
  box-shadow: 0 3px 12px 0 rgba(197, 176, 153, 0.4);
  background: #fff;
  border: none;
  border-radius: 12px;
  border-radius: calc(12px * var(--fit-scale));
  font-weight: 500;
  font-size: clamp(16px, 5vw, 22px);
  font-size: clamp(14px, calc(22px * var(--fit-scale) * var(--learn-locale-text-scale)), 22px);
  line-height: var(--learn-locale-line-height);
  text-align: center;
  color: var(--black);
  font-family: inherit;
  overflow-wrap: anywhere;
  word-break: normal;
}

.slide__answer-btn:not(.correct):disabled:active {
  outline: 2px solid var(--false-color);
  box-shadow: none;
}

.slide__answer-btn:disabled {
  pointer-events: none;
}

.slide__answer-btn--symbol {
  font-size: 40px;
  font-size: clamp(24px, calc(40px * var(--fit-scale)), 40px);
  line-height: 2;
  font-weight: 400;
  font-family: var(--second-family);
  direction: var(--tl-dir, rtl);
  /* padding-bottom: 18px; */
}

.slide__answer-btn-text {
  display: block;
  width: 100%;
  min-width: 0;
}

.slide__answer-btn--with-pic {
  height: 140px;
  padding: 0;
  font-size: 70px;
}

.slide__answer-btn--long {
  font-size: 36px;
  font-size: clamp(18px, calc(36px * var(--fit-scale)), 36px);
  font-weight: 400;
  line-height: 2.22;
}

.slide__answer-btn--sentence {
  font-size: clamp(13px, calc(17px * var(--fit-scale) * var(--learn-locale-dense-text-scale)), 17px);
  font-weight: 400;
  line-height: max(1.4, var(--learn-locale-line-height));
}

/* @media (max-device-width: 375px) {
  .slide__answer-btn {
    height: 60px;
  }

  .slide__answer-btn--symbol {
    font-size: 40px;
    padding-bottom: 0;
  }

  .slide__answer-btn--with-pic {
    height: 108px;
    padding: 0;
    font-size: 60px;
  }
} */

.slide__answer-btn.wrong {
  outline: 2px solid var(--false-color);
  box-shadow: none;
  animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.slide__answer-btn.correct {
  color: var(--true-color);
  outline: 2px solid var(--true-color-light);
  box-shadow: none;
}

.slide__recording {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: clamp(100%, calc(80px * var(--fit-scale)), 80px);
  max-height: 80px;
  padding: 5px 16px;
  background: var(--ui-panel);
  border-radius: var(--radius);
}

.slide__symbol:has(+ .slide__recognize) {
  grid-row: 1 / 3;
}

.slide__recognize {
  grid-row: 3 / -1;
  display: flex;
  flex-direction: column;
  row-gap: calc(var(--gap-row) * var(--fit-scale));
  position: relative;
}

.slide__recognize .player {
  margin: auto;
}

.mic-btn,
.replay-btn {
  /* width: 48px;
  height: 48px; */
  width: clamp(32px, calc(60px * var(--fit-scale)), 48px);
  height: clamp(32px, calc(60px * var(--fit-scale)), 48px);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 100%;
  border: none;
  box-shadow: 0 3px 12px 0 rgba(197, 176, 153, 0.4);
  background-color: #fff;
}

.mic-btn svg,
.replay-btn svg {
  max-height: 50%;
}

.mic-btn__icon--pause {
  display: none;
}

.mic-btn.recording .mic-btn__icon--mic {
  display: none;
}

.mic-btn.recording {
  animation: pulse 1s infinite ease-in-out;
}

.mic-btn.recording .mic-btn__icon--pause {
  display: block;
}

/* @media (max-device-width: 375px) {
  .mic-btn,
  .replay-btn {
    width: 36px;
    height: 36px;
  }

  .mic-btn svg,
  .replay-btn svg {
    width: auto;
    height: 20px;
  }
} */

.mic-btn,
.replay-btn {
  & svg path {
    transition: fill 0.5s ease;
  }
}

.mic-btn.recording {
  & svg:not(.mic-btn__icon) path {
    fill: red !important;
  }
}

.mic-btn:disabled,
.replay-btn:disabled {
  & svg path {
    fill: #e7e7e7 !important;
  }
}

.btn--mic.recording {
  background-color: var(--lb-red);
}
.slide__record-info-text {
  margin-top: 14px;
  text-align: center;
  font-weight: 400;
  font-size: 14px;
  text-align: center;
  color: var(--gray-transcriptions);
}

.slide__audio-text-animation:not(.rt-richtext) {
  /* position: relative; */
  direction: var(--tl-dir, rtl);
  font-family: var(--second-family);
  font-weight: 400;
  font-size: 60px;
  font-size: clamp(20px, calc(60px * var(--fit-scale)), 60px);
  line-height: 2;
  text-align: center;
  color: #000;
}

/* @media (max-device-width: 375px) {
  .slide__audio-text-animation {
    font-size: 48px;
  }
} */

.slide__audio-text-animation:not(.rt-richtext) span {
  color: var(--main-green);
}

.slide__audio-text-animation-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--ui-panel);
  grid-row: 1 / 3;
  border-radius: var(--radius);
  padding-bottom: clamp(10px, calc(16px * var(--fit-scale)), 16px);
  min-height: calc(var(--h-row) * 2 * var(--fit-scale) + calc(var(--gap-row) * var(--fit-scale)));
}

.slide__audio-text-animation-container + .slide__symbol-transcription {
  grid-row: 3 / 4;
  align-self: end;
}

.slide__audio-text-animation + [data-field]:not(.rt-richtext) {
  font-weight: 500;
  font-size: clamp(16px, calc(20px * var(--fit-scale)), 20px);
}

.slide__symbol:has(+ .slide__audio-text-wrapper) {
  grid-row: 1 / 3;
}

.slide__audio-text-wrapper {
  grid-row: 3 / -1;
  display: grid;
  grid-template-rows: repeat(4, calc(var(--h-row) * var(--fit-scale)));
  row-gap: calc(var(--gap-row) * var(--fit-scale));
}

.slide__audio-text-wrapper .slide__audio-btn {
  grid-row: 4 / -1;
}

.slide__audio-text-wrapper .slide__symbol-transcription {
  margin-bottom: 0;
}

.progress {
  width: 100%;
  height: 12px;
  background: #f0f0f0;
  border-radius: 6px;
  overflow: hidden;
}

.progress .bar {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--lb-blue), var(--green-light));
  transition: width 0.2s ease;
}

.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  height: 48px;
  gap: 2px;
}

.waveform__bar {
  width: 2px;
  height: 2px;
  border-radius: 2px;
  background-color: #b4b2ab;
  transition:
    height 0.15s ease,
    background-color 0.3s ease;
}

.waveform__bar.active {
  background-color: var(--main-green);
}

.dragdrop {
  grid-row: 1 / -1;
  margin: auto;
  /* display: flex;
  justify-content: space-between; */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--gap-row) * var(--fit-scale));
  width: 100%;
}

.dragdrop__col {
  display: grid;
  grid-template-rows: repeat(4, calc(var(--h-row) * var(--fit-scale)));
  row-gap: calc(var(--gap-row) * var(--fit-scale));
  /* width: 50%; */
}

.dragdrop__placeholder {
  height: 0 !important;
}

.dragdrop__col .dragdrop__item:nth-child(1) {
  grid-row: 1 / 2;
}
.dragdrop__col .dragdrop__item:nth-child(2) {
  grid-row: 2 / 3;
}
.dragdrop__col .dragdrop__item:nth-child(3) {
  grid-row: 3 / 4;
}
.dragdrop__col .dragdrop__item:nth-child(4) {
  grid-row: 4 / 5;
}

.dragdrop--sentence {
  font-size: clamp(13px, calc(17px * var(--fit-scale)), 17px);
}

.dragdrop__item {
  width: 100%;
  height: calc(var(--h-row) * var(--fit-scale));
  box-shadow: 0 3px 12px 0 rgba(197, 176, 153, 0.4);
  background: #fff;
  border-radius: 12px;
  border-radius: calc(12px * var(--fit-scale));
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: grab;
  transition: background 0.3s;
  font-weight: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  direction: inherit;
  text-align: inherit;
  border: 1px solid transparent;

  touch-action: none;

  -webkit-touch-callout: none;
  user-select: none;
}

.dragdrop__item.active {
  border: 1px solid var(--main-yellow);
  box-shadow: 0 3px 14px 0 rgba(197, 176, 153, 0.81);
}

.dragdrop__item.wrong {
  border-color: var(--false-color);
}

.dragdrop__slot {
  position: relative;
  overflow: hidden;
  padding: 5px;
  border: 1px dashed var(--light-yellow);
  border-radius: 12px;
  border-radius: calc(12px * var(--fit-scale));
  width: 100%;
  height: calc(var(--h-row) * var(--fit-scale));
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  user-select: none;
  transition: border-color 0.5s ease;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: inherit;
  color: inherit;
  direction: inherit;
}

.dragdrop__slot-label {
  display: block;
  width: 100%;
}

/* @media (max-device-width: 375px) {
  .dragdrop__item,
  .dragdrop__slot {
    height: 56px;
  }

  .dragdrop__item {
    font-size: 30px;
  }

  .dragdrop__col {
    grid-template-rows: repeat(3, 60px) max-content;
  }
} */

.dropzone.correct {
  overflow: hidden;
  border: 1px solid var(--true-color-light);
  outline: 2px solid var(--true-color-light);
  outline-offset: -1px;
  color: var(--true-color-light);
}

.dragdrop__slot .dragdrop__item {
  position: absolute;
  inset: 0;
  min-width: unset;
  min-height: unset;
  width: 100%;
  height: 100%;
  font-size: inherit;
  line-height: inherit;
  font-family: inherit;
  direction: inherit;
  text-align: inherit;
  margin: 0;
  color: inherit;
  border-radius: inherit;
  background-color: #fff;
  box-shadow: none;
  padding: 0;
}

.dragdrop__slot.correct {
  padding: 0;
  border: 1px solid var(--true-color-light);
  color: var(--true-color);
}

.dragdrop__slot.correct .dragdrop__slot-label {
  display: none;
}

@keyframes bounceBack {
  0% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(-15px);
  }
  60% {
    transform: translateX(10px);
  }
  80% {
    transform: translateX(-5px);
  }
  100% {
    transform: translateX(0);
  }
}

.bounce-back {
  animation: bounceBack 0.4s ease;
}

.slide__pic-with-icon {
  grid-row: 2 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap);
}

.slide__image {
  display: block;
  grid-row: 1 / 3;
  height: auto;
}

.slide--i-5 .slide__image {
  display: block;
  grid-row: 1 / -1;
  height: auto;
}

.slide__text-content {
  grid-row: 1 / -1;
  /* height: 100%;
  max-height: 54dvh; */
  overflow-y: scroll;
  scrollbar-color: transparent transparent;
  scrollbar-width: thin;

  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: calc(6px * var(--fit-scale));
  font-size: clamp(14px, calc(24px * var(--fit-scale)), 24px);
}

.slide__image + .slide__text-content {
  grid-row: 3 / -1;
  max-height: 200px;
}

.slide__image + .slide__text-content {
  max-height: 210px;
  overflow-y: scroll;
}

/* I-4 optional image-down layout. Legacy slides without imagePosition stay image-up. */
.slide--i-4.slide--i-4-image-down .slide__content:has(.slide__text-content) {
  flex-direction: column;
}

.slide--i-4.slide--i-4-image-down .slide__text-content {
  order: -1;
  max-height: 210px;
}

.slide--i-4.slide--i-4-image-down .slide__image {
  margin-top: auto;
}

.slide--i-4.slide--i-4-image-down .slide__content:not(:has(.slide__text-content)) .slide__image {
  grid-row: 3 / -1;
}

@media (max-width: 375px) {
  .slide__image {
    max-height: 150px;
  }

  .slide__image + .slide__text-content {
    max-height: 170px;
  }
}

.slide__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  row-gap: calc(var(--gap-row) * var(--fit-scale));
  grid-row: 1 / -1;
  margin: auto;
  width: 100%;
}

.slide__list li {
  min-height: 108px;
  padding-top: 20px;
  padding-bottom: 20px;
  padding-left: 19px;
  padding-right: 22px;
  font-size: 20px;
}

.slide__list:not(.slide__list--audio) {
  margin: 0;
  width: 100%;
  max-height: 50dvh;
  overflow-y: auto;
  grid-auto-rows: max-content;
  align-content: start;
  justify-items: stretch;
  row-gap: 12px;
}

.slide__list:not(.slide__list--audio) > li {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: unset;
  width: 100%;
  max-width: 100%;
  height: auto;
  box-sizing: border-box;
  justify-self: stretch;
  align-self: start;
  padding-top: 1lh;
  padding-bottom: 1lh;
}

.slide__list:not(.slide__list--audio) > li.rt-richtext {
  --rt-justify-self: stretch !important;
  --rt-margin-inline: 0 !important;
  display: block !important;
  font-size: var(--rt-font-size, 20px);
  justify-self: stretch !important;
  margin-inline: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

.slide__list:not(.slide__list--audio) > li.rt-richtext > :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6) {
  width: 100% !important;
  max-width: 100% !important;
  margin-inline: 0 !important;
}

.slide--i-6 .slide__list:not(.slide__list--audio) > li {
  min-height: 48px;
  overflow-wrap: anywhere;
  padding-top: calc(8px * var(--fit-scale));
  padding-bottom: calc(8px * var(--fit-scale));
  padding-left: calc(10px * var(--fit-scale));
  padding-right: calc(10px * var(--fit-scale));
}

.slide--i-6 .slide__content > .slide__list:not(.slide__list--audio) {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  grid-template-columns: minmax(0, 1fr);
  row-gap: calc(var(--gap-row) * var(--fit-scale));
  scrollbar-width: thin;
  scrollbar-color: var(--main-green) transparent;
}

.slide--i-6 .slide__list:not(.slide__list--audio) > li li {
  min-height: 0;
  padding: 0;
  font-size: inherit;
  background: transparent;
}

.slide--i-6 .slide__list:not(.slide__list--audio) pre {
  white-space: pre-wrap;
}

.slide__list li {
  background-color: var(--ui-panel);
  border-radius: var(--radius);
  border-radius: calc(var(--radius) * var(--fit-scale));
}

.slide__list--audio {
  grid-row: 1 / -1;
}

.slide__list--audio .slide__list-item {
  display: grid;
  grid-template-columns: 1fr calc(var(--h-row) * var(--fit-scale));
  min-height: calc(var(--h-row) * var(--fit-scale));
  padding: 0;
}

.slide__word {
  font-weight: 500;
}

.slide__list-item .slide__word {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  text-align: center;
}

.slide__list-item .slide__symbol {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
}

.slide__list-item .slide__media {
  grid-column: 2 / 3;
  grid-row: 1 / 3;

  display: flex;
  justify-content: center;
  align-items: center;
}

.slide__list--long li {
  /* display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; */
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  min-height: 80px;
  padding-top: 8px;
  padding-bottom: 8px;
  font-weight: 500;
  background-color: var(--ui-panel);
  border-radius: var(--radius);
  border-radius: calc(var(--radius) * var(--fit-scale));
}

.slide__list--long .slide__symbol {
  text-align: center;
  grid-column: 1 / 3;
  grid-row: 1 / 2;
}

.slide__list--long .slide__word {
  text-align: center;
  grid-column: 1 / 3;
}

@media (max-device-width: 375px) {
  .slide__list--long li {
    min-height: 60px;
    min-height: clamp(60px, calc(80px * var(--fit-scale)), 80px);
  }
}

.slide__list--long .slide__media {
  grid-column: 3 / 4;
  grid-row: 1 / 3;
}

.a1-role-badge,
.a1-character-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: calc(34px * var(--fit-scale));
  min-height: calc(34px * var(--fit-scale));
  padding: 0 calc(8px * var(--fit-scale));
  border-radius: calc(var(--radius) * var(--fit-scale));
  background: var(--ui-panel);
  color: var(--main-green);
  font-weight: 700;
  font-size: clamp(11px, calc(14px * var(--fit-scale)), 14px);
  line-height: 1;
}

.a1-vocab-card,
.a1-example-card {
  grid-row: 1 / -1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  row-gap: calc(var(--gap-row) * var(--fit-scale));
  width: 100%;
}

.a1-vocab-card--schema {
  grid-template-rows: auto minmax(0, 1fr);
  align-content: center;
}

.a1-vocab-card__image,
.a1-example-card__image,
.a1-compare-card__image {
  display: block;
  max-width: 100%;
  max-height: calc(var(--h-row) * 1.7 * var(--fit-scale));
  object-fit: contain;
  margin: 0 auto;
}

.a1-vocab-card__body,
.a1-example-card {
  min-height: 0;
}

.a1-vocab-card__body--stacked {
  display: grid;
  justify-items: center;
  align-content: center;
  row-gap: calc(8px * var(--fit-scale));
}

.a1-bordered-block {
  width: 100%;
  min-height: calc(48px * var(--fit-scale));
  display: grid;
  align-content: center;
  justify-items: center;
  padding: calc(8px * var(--fit-scale)) calc(10px * var(--fit-scale));
  border: none;
  border-radius: calc(var(--radius) * var(--fit-scale));
  background: var(--ui-panel);
  box-sizing: border-box;
}

.a1-bordered-block--arabic {
  row-gap: calc(2px * var(--fit-scale));
}

.slide--i-16 .a1-bordered-block {
  background: #fff;
}

.a1-vocab-card__footer {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: calc(8px * var(--fit-scale));
}

.slide--i-16 .a1-vocab-card__footer,
.slide--i-17 .a1-compare-card__meta,
.slide--i-18 .a1-example-card__audio {
  margin-top: calc(6px * var(--fit-scale));
}

.a1-part-of-speech-label {
  color: #9a9a9a;
  font-size: clamp(11px, calc(13px * var(--fit-scale)), 13px);
}

.a1-vocab-card__meta,
.a1-compare-card__meta,
.a1-four-card__meta {
  min-height: calc(36px * var(--fit-scale));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(8px * var(--fit-scale));
}

.a1-arabic-hero,
.a1-compare-card__arabic,
.a1-four-card__arabic,
.a1-example-row__arabic,
.a1-dialogue-line__arabic,
.a1-practice-line__text,
.a1-reading-statement,
.a1-reading-text,
.a1-fill-line__sentence {
  direction: var(--tl-dir, rtl);
  font-family: var(--second-family);
  font-weight: 400;
  color: var(--black);
}

.a1-arabic-hero {
  text-align: center;
  font-size: clamp(36px, calc(60px * var(--fit-scale)), 60px);
  line-height: 1.35;
}

.a1-translation,
.a1-comment,
.a1-compare-card__translation,
.a1-four-card__translation,
.a1-example-row__translation,
.a1-dialogue-line__translation {
  color: var(--gray-transcriptions);
  font-weight: 500;
  font-size: clamp(13px, calc(18px * var(--fit-scale) * var(--learn-locale-text-scale)), 18px);
  line-height: max(1.25, var(--learn-locale-line-height));
  text-align: center;
  overflow-wrap: anywhere;
  word-break: normal;
}

.a1-comment {
  margin-top: calc(8px * var(--fit-scale));
  color: var(--ui-muted-text);
  font-size: clamp(12px, calc(15px * var(--fit-scale) * var(--learn-locale-dense-text-scale)), 15px);
}

.a1-compare-grid {
  grid-row: 1 / -1;
  display: grid;
  gap: calc(var(--gap-row) * var(--fit-scale));
  min-height: 0;
}

.a1-compare-grid--two {
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

.slide--i-17 .a1-compare-grid--two {
  grid-template-rows: auto auto auto auto;
  align-items: stretch;
}

.slide--i-17 .a1-compare-card {
  display: contents;
}

.slide--i-17 .a1-compare-card--left > * {
  grid-column: 1;
}

.slide--i-17 .a1-compare-card--right > * {
  grid-column: 2;
}

.slide--i-17 .a1-compare-card__row-image {
  grid-row: 1;
}

.slide--i-17 .a1-compare-card__row-arabic {
  grid-row: 2;
}

.slide--i-17 .a1-compare-card__row-translation {
  grid-row: 3;
}

.slide--i-17 .a1-compare-card__row-meta {
  grid-row: 4;
}

.a1-compare-card,
.a1-four-card {
  min-width: 0;
  min-height: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  row-gap: calc(6px * var(--fit-scale));
  padding: calc(10px * var(--fit-scale));
  border-radius: calc(var(--radius) * var(--fit-scale));
  background: var(--ui-panel);
}

.a1-compare-card {
  background: transparent;
  align-content: start;
}

.a1-compare-card__arabic,
.a1-four-card__arabic,
.a1-example-row__arabic {
  text-align: center;
  font-size: clamp(26px, calc(42px * var(--fit-scale)), 42px);
  line-height: 1.25;
}

.a1-example-card {
  align-content: center;
  justify-items: center;
}

.a1-example-card__body {
  display: grid;
  justify-items: center;
  row-gap: calc(8px * var(--fit-scale));
  min-height: calc(var(--h-row) * 2 * var(--fit-scale));
}

.a1-example-card__audio {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.a1-example-card__subtitle,
.a1-subtitle,
.a1-builder-prompt,
.a1-practice-instruction {
  text-align: center;
  color: var(--ui-muted-text);
  font-weight: 500;
  font-size: clamp(13px, calc(18px * var(--fit-scale)), 18px);
  line-height: 1.25;
}

.a1-scroll-list {
  grid-row: 1 / -1;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  display: grid;
  align-content: start;
  row-gap: calc(10px * var(--fit-scale));
  width: 100%;
  margin: 0;
  padding: 0 calc(4px * var(--fit-scale)) 0 0;
  list-style: none;
}

.a1-scroll-list--examples {
  grid-row: 2 / -1;
}

.a1-example-row,
.a1-dialogue-line,
.a1-fill-line {
  min-height: calc(var(--h-row) * var(--fit-scale));
  display: grid;
  align-items: center;
  gap: calc(8px * var(--fit-scale));
  padding: calc(10px * var(--fit-scale));
  border-radius: calc(var(--radius) * var(--fit-scale));
  background: var(--ui-panel);
}

.a1-example-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.a1-example-row__text {
  min-width: 0;
}

.a1-example-row__heading {
  color: var(--lb-blue);
  font-weight: 700;
  font-size: clamp(12px, calc(16px * var(--fit-scale)), 16px);
  line-height: 1.1;
  text-align: center;
}

.slide--i-19 .slide__content {
  grid-template-rows: minmax(0, 1fr);
  row-gap: 0;
}

.slide--i-19 .a1-scroll-list--examples {
  grid-row: 1 / -1;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  row-gap: calc(var(--gap-row) * var(--fit-scale));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding-inline-end: calc(4px * var(--fit-scale));
  scrollbar-width: thin;
  scrollbar-color: var(--main-green) transparent;
}

.slide--i-19 .a1-scroll-list--examples::-webkit-scrollbar {
  width: calc(6px * var(--fit-scale));
}

.slide--i-19 .a1-scroll-list--examples::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--main-green);
}

.slide--i-19 .a1-scroll-list--examples::-webkit-scrollbar-track {
  background: transparent;
}

.slide--i-19 .a1-example-row {
  flex: 1 0 auto;
  min-height: calc(var(--h-row) * 1.25 * var(--fit-scale));
  height: auto;
  padding: calc(8px * var(--fit-scale)) calc(10px * var(--fit-scale));
}

.slide--i-19 .a1-example-row__text {
  display: grid;
  align-content: center;
  justify-items: center;
  row-gap: calc(2px * var(--fit-scale));
}

.slide--i-19 .a1-example-row__heading,
.slide--i-19 .a1-example-row__arabic,
.slide--i-19 .a1-example-row__translation {
  line-height: 1.2;
}

/* These 393px designs share the learner's 430px logical phone stage. */
:is(.slide--cs-1-1, .slide--rd-4, .slide--i-21, .slide--i-23, .a1-word-chip--rd4) {
  --lesson-scale: var(--fit-scale);
}

.app-layout--fixed-phone :is(.slide--cs-1-1, .slide--rd-4, .slide--i-21, .slide--i-23, .a1-word-chip--rd4) {
  --lesson-scale: calc(430 / 393 * var(--fit-scale));
}

:is(.slide--cs-1-1, .slide--rd-4, .slide--i-21, .slide--i-23) {
  grid-template-rows: auto minmax(0, 1fr);
}

/* The sequence and vocabulary slides share the same word-over-caption cards. */
.slide--i-23 .slide__content {
  grid-template-rows: minmax(0, 1fr);
}

.i23-list,
.i21-chain {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  list-style: none;
}

.i23-list {
  --i23-density-scale: 1;
  gap: calc(36px * var(--lesson-scale) * var(--i23-density-scale));
}

.i23-card,
.i21-chain .i21-node {
  --card-scale: calc(var(--lesson-scale) * var(--i23-density-scale, 1));
  display: grid;
  flex: none;
  justify-items: center;
  align-content: center;
  gap: calc(18px * var(--card-scale));
  width: min(100%, calc(304px * var(--lesson-scale)));
  min-width: 0;
  padding: calc(16px * var(--card-scale)) calc(18px * var(--card-scale));
  border: 1px solid var(--lesson-card-border, #dbdbdb);
  border-radius: calc(8px * var(--lesson-scale));
  background: var(--lesson-card-bg, #fff);
  box-shadow: none;
  overflow-wrap: anywhere;
  text-align: center;
}

.i23-card .i23-card__anchor,
.i21-chain .i21-node__arabic {
  color: var(--rt-color, var(--green-light));
  font-family: var(--rt-font-family, var(--second-family));
  font-size: var(--rt-font-size, calc(26px * var(--card-scale)));
  font-weight: var(--rt-font-weight, 600);
  line-height: var(--rt-line-height, 1.25);
  text-align: var(--rt-text-align, center);
}

.i23-card .i23-card__copy,
.i21-chain .i21-node__caption,
.i21-chain .i21-chain__edge-label {
  color: var(--rt-color, var(--lesson-caption, #454545));
  font-size: var(
    --rt-font-size,
    calc(14px * var(--card-scale, var(--lesson-scale)) * var(--learn-locale-dense-text-scale))
  );
  font-weight: var(--rt-font-weight, 600);
  line-height: var(--rt-line-height, var(--learn-locale-line-height));
  text-align: var(--rt-text-align, center);
}

.i23-card__copy.rt-richtext {
  max-height: none !important;
  overflow: visible !important;
}

:is([data-theme='dark'], .theme-dark, .dark-theme) :is(.slide--i-23, .slide--i-21) {
  --lesson-card-bg: #242d2a;
  --lesson-card-border: #46534d;
  --lesson-caption: #f5f1e8;
}

/* I-20 grammar table and I-21 static relationship diagrams. */
.slide--i-20,
.slide--i-21,
.slide--i-22 {
  --info-structure-surface: var(--light-grey);
  --info-structure-card: #fff;
  --info-structure-card-alt: var(--ui-panel);
  --info-structure-border: #d8d2c6;
  --info-structure-line: #6fb9aa;
  --info-structure-muted: var(--ui-muted-text);
  --info-structure-text: var(--black);
}

.slide--i-20 {
  grid-template-rows: calc(var(--h-title) * var(--fit-scale)) minmax(max-content, 1fr);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--info-structure-line) transparent;
}

.slide--i-20 .slide__content,
.slide--i-21 .slide__content {
  grid-template-rows: minmax(0, 1fr);
  row-gap: 0;
  width: 100%;
  max-width: 867px;
  min-width: 0;
  min-height: 0;
  margin-inline: auto;
}

.slide--i-20 .slide__content {
  grid-template-rows: minmax(max-content, 1fr);
  align-content: start;
  overflow: visible;
}

.slide--i-20.slide--info-text-before .slide__content:has(.i20-intro) {
  grid-template-rows: auto minmax(max-content, 1fr);
  row-gap: calc(12px * var(--fit-scale));
}

.slide--i-20.slide--info-text-after .slide__content:has(.i20-intro) {
  grid-template-rows: minmax(max-content, 1fr) auto;
  row-gap: calc(18px * var(--fit-scale));
}

.i20-intro {
  min-width: 0;
  max-height: none;
  overflow: visible;
  padding-inline: calc(2px * var(--fit-scale));
  color: var(--info-structure-text);
  font-size: clamp(13px, calc(18px * var(--fit-scale) * var(--learn-locale-dense-text-scale)), 18px);
  line-height: max(1.35, var(--learn-locale-line-height));
  text-align: start;
}

.i20-intro > :first-child {
  margin-block-start: 0;
}

.i20-intro > :last-child {
  margin-block-end: 0;
}

.info-optional-text--before {
  position: relative;
  z-index: 1;
  transform: translateY(var(--info-before-offset-y, 0px));
}

.i20-table-frame {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: stretch;
  overflow: visible;
  border: 1px solid var(--info-structure-border);
  border-radius: calc(var(--radius) * var(--fit-scale));
  background: var(--info-structure-card);
}

.slide--i-20 .slide__content:not(:has(.i20-intro)) .i20-table-frame {
  height: calc(100% + calc(36px * var(--fit-scale)));
  transform: translateY(calc(-36px * var(--fit-scale)));
}

.slide--i-20::-webkit-scrollbar {
  width: calc(6px * var(--fit-scale));
}

.slide--i-20::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--info-structure-line);
}

.slide--i-20::-webkit-scrollbar-track {
  background: transparent;
}

.i20-table {
  width: 100%;
  height: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  direction: ltr;
  color: var(--info-structure-text);
  background: var(--info-structure-card);
}

.slide--i-20-3-columns .i20-table col {
  width: 33%;
}

.slide--i-20-3-columns .i20-table .i20-table__arabic-column {
  width: 34%;
}

.slide--i-20-2-columns .i20-table col {
  width: 60%;
}

.slide--i-20-2-columns .i20-table .i20-table__arabic-column {
  width: 40%;
}

.i20-table th,
.i20-table td {
  min-width: 0;
  padding: calc(6px * var(--fit-scale)) calc(8px * var(--fit-scale));
  border-block-end: 1px solid var(--info-structure-border);
  overflow-wrap: anywhere;
  word-break: normal;
  vertical-align: middle;
}

.i20-table th:not(:last-child),
.i20-table td:not(:last-child) {
  border-right: 1px solid var(--info-structure-border);
}

.i20-table tbody tr:last-child td {
  border-block-end: 0;
}

.i20-table thead {
  background: var(--info-structure-card-alt);
}

.i20-table th {
  height: calc(38px * var(--fit-scale));
  color: var(--rt-color, var(--info-structure-muted));
  font-size: var(
    --rt-font-size,
    clamp(10px, calc(13px * var(--fit-scale) * var(--learn-locale-dense-text-scale)), 13px)
  );
  font-weight: var(--rt-font-weight, 500);
  line-height: var(--rt-line-height, 1.15);
  text-align: var(--rt-text-align, start);
}

.i20-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--info-structure-surface) 62%, transparent);
}

.i20-table__arabic {
  direction: var(--tl-dir, rtl);
  color: var(--info-structure-text);
  font-family: var(--second-family);
  font-size: clamp(20px, calc(30px * var(--fit-scale)), 30px);
  font-weight: 400;
  line-height: 1.25;
  text-align: right;
}

.i20-table__english {
  direction: ltr;
  color: var(--info-structure-text);
  font-size: clamp(12px, calc(17px * var(--fit-scale) * var(--learn-locale-dense-text-scale)), 17px);
  font-weight: 500;
  line-height: max(1.2, var(--learn-locale-line-height));
  text-align: left;
}

.i20-table__note {
  color: var(--info-structure-muted);
  font-weight: 400;
}

.i21-map,
.i21-chain {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.slide--i-21.slide--info-text-before .slide__content:has(.i21-footer-text) {
  grid-template-rows: auto minmax(0, 1fr);
  row-gap: calc(10px * var(--fit-scale));
}

.slide--i-21.slide--info-text-after .slide__content:has(.i21-footer-text) {
  grid-template-rows: minmax(0, 1fr) auto;
  row-gap: calc(16px * var(--fit-scale));
}

.slide--i-21 .i21-footer-text {
  min-width: 0;
  max-height: calc(110px * var(--lesson-scale));
  overflow-y: auto;
  color: var(--rt-color, var(--info-structure-text));
  font-size: var(--rt-font-size, calc(18px * var(--lesson-scale) * var(--learn-locale-text-scale)));
  font-weight: var(--rt-font-weight, 500);
  line-height: var(--rt-line-height, max(1.38, var(--learn-locale-line-height)));
  text-align: var(--rt-text-align, center);
}

.i21-footer-text > :first-child {
  margin-block-start: 0;
}

.i21-footer-text > :last-child {
  margin-block-end: 0;
}

.slide--i-22 .slide__content {
  grid-template-rows: minmax(0, 1fr);
  row-gap: calc(18px * var(--fit-scale));
  width: 100%;
  max-width: 867px;
  min-width: 0;
  min-height: 0;
  margin-inline: auto;
}

.slide--i-22 .slide__content:has(> .i22-body) {
  grid-template-rows: auto minmax(0, 1fr);
}

.i22-visual {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  row-gap: calc(18px * var(--fit-scale));
}

.i22-body {
  min-width: 0;
  max-height: calc(112px * var(--fit-scale));
  overflow-y: auto;
  padding-inline: calc(2px * var(--fit-scale));
  color: var(--info-structure-text);
  font-size: clamp(14px, calc(19px * var(--fit-scale) * var(--learn-locale-dense-text-scale)), 19px);
  line-height: max(1.4, var(--learn-locale-line-height));
  text-align: start;
}

.i22-body > :first-child,
.i22-legend__explanation > :first-child {
  margin-block-start: 0;
}

.i22-body > :last-child,
.i22-legend__explanation > :last-child {
  margin-block-end: 0;
}

.i22-phrase {
  min-width: 0;
  min-height: calc(120px * var(--fit-scale));
  display: grid;
  place-items: center;
  color: var(--info-structure-text);
  font-family: var(--second-family);
  font-size: clamp(46px, calc(72px * var(--fit-scale)), 72px);
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
}

.i22-phrase__word {
  display: inline;
}

.i22-phrase__part {
  display: inline;
}

.i22-legend {
  --i22-legend-count: 3;
  min-width: 0;
  min-height: 0;
  max-height: calc(320px * var(--fit-scale));
  display: grid;
  grid-template-rows: repeat(var(--i22-legend-count), max-content);
  align-content: start;
  row-gap: calc(9px * var(--fit-scale));
  margin: 0;
  padding: 0 calc(3px * var(--fit-scale));
  list-style: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--info-structure-line) transparent;
}

.i22-legend::-webkit-scrollbar {
  width: calc(6px * var(--fit-scale));
}

.i22-legend::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--info-structure-line);
}

.i22-legend__row {
  min-width: 0;
  display: grid;
  grid-template-columns:
    calc(18px * var(--fit-scale)) minmax(calc(54px * var(--fit-scale)), calc(92px * var(--fit-scale)))
    minmax(0, 1fr);
  align-items: start;
  column-gap: calc(12px * var(--fit-scale));
  padding-block: calc(6px * var(--fit-scale));
}

.i22-legend__dot {
  width: calc(16px * var(--fit-scale));
  height: calc(16px * var(--fit-scale));
  margin-block-start: calc(8px * var(--fit-scale));
  border-radius: 50%;
  background: currentColor;
}

.i22-legend__arabic {
  min-width: 0;
  font-family: var(--second-family);
  font-size: clamp(23px, calc(34px * var(--fit-scale)), 34px);
  font-weight: 400;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
}

.i22-legend__explanation {
  min-width: 0;
  color: var(--info-structure-text);
  font-size: clamp(12px, calc(17px * var(--fit-scale) * var(--learn-locale-dense-text-scale)), 17px);
  line-height: max(1.4, var(--learn-locale-line-height));
  text-align: start;
  overflow-wrap: anywhere;
}

.i22-tone-1:is(.i22-phrase__part),
.i22-tone-1 :is(.i22-legend__dot, .i22-legend__arabic) {
  color: var(--main-green);
}

.i22-tone-2:is(.i22-phrase__part),
.i22-tone-2 :is(.i22-legend__dot, .i22-legend__arabic) {
  color: #92948f;
}

.i22-tone-3:is(.i22-phrase__part),
.i22-tone-3 :is(.i22-legend__dot, .i22-legend__arabic) {
  color: #d34232;
}

.i21-map {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.i21-map__edges {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.i21-map__edges line {
  vector-effect: non-scaling-stroke;
  stroke: var(--info-structure-line);
  stroke-width: 2;
  stroke-linecap: round;
}

.i21-node {
  min-width: 0;
  min-height: calc(66px * var(--fit-scale));
  display: grid;
  align-content: center;
  justify-items: center;
  row-gap: calc(3px * var(--fit-scale));
  padding: calc(7px * var(--fit-scale)) calc(8px * var(--fit-scale));
  border: 1px solid var(--info-structure-border);
  border-radius: calc((var(--radius) + 4px) * var(--fit-scale));
  color: var(--info-structure-text);
  background: var(--info-structure-card);
  box-shadow: 0 calc(2px * var(--fit-scale)) calc(7px * var(--fit-scale)) rgba(25, 50, 44, 0.09);
  overflow: hidden;
}

.i21-node__arabic {
  max-width: 100%;
  direction: var(--tl-dir, rtl);
  color: var(--info-structure-text);
  font-family: var(--second-family);
  font-size: clamp(18px, calc(27px * var(--fit-scale)), 27px);
  font-weight: 400;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
}

.i21-node__caption {
  max-width: 100%;
  direction: ltr;
  color: var(--info-structure-muted);
  font-size: clamp(9px, calc(12px * var(--fit-scale) * var(--learn-locale-dense-text-scale)), 12px);
  font-weight: 500;
  line-height: max(1.15, var(--learn-locale-line-height));
  text-align: center;
  overflow-wrap: anywhere;
}

.i21-node--hub {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 35%;
  max-width: 190px;
  min-height: calc(78px * var(--fit-scale));
  transform: translate(-50%, -50%);
  border: 2px solid var(--main-green);
  background: var(--info-structure-card-alt);
}

.i21-map__branch,
.i21-map__edge-label {
  position: absolute;
  top: var(--i21-y);
  left: var(--i21-x);
  transform: translate(-50%, -50%);
}

.i21-map__branch {
  z-index: 2;
  width: 30%;
  max-width: 180px;
}

.i21-node--branch {
  width: 100%;
}

.i21-edge-label {
  z-index: 4;
  max-width: 30%;
  padding: calc(2px * var(--fit-scale)) calc(5px * var(--fit-scale));
  border-radius: 999px;
  color: var(--info-structure-muted);
  background: var(--info-structure-surface);
  font-size: clamp(8px, calc(10px * var(--fit-scale) * var(--learn-locale-dense-text-scale)), 10px);
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}

.i21-chain {
  height: auto;
  max-height: 100%;
  align-self: center;
}

.i21-chain__step,
.i21-chain__edge {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.i21-chain .i21-node {
  min-height: 0;
}

.i21-chain .i21-node > :empty {
  display: none;
}

.i21-chain__arrow {
  display: grid;
  place-items: center;
  height: calc(36px * var(--lesson-scale));
}

.i21-chain__arrow::before {
  content: '';
  width: calc(36px * var(--lesson-scale));
  height: calc(7.4px * var(--lesson-scale));
  background: url('/brand/slides/i-21/arrow.svg') center / contain no-repeat;
  transform: rotate(90deg);
}

.i21-chain .i21-chain__edge-label {
  max-width: 95%;
  padding: calc(16px * var(--lesson-scale));
  border-radius: calc(4px * var(--lesson-scale));
  background: var(--info-structure-surface);
}

@media (max-width: 370px) {
  .i20-table th,
  .i20-table td {
    padding-inline: calc(4px * var(--fit-scale));
  }

  .i20-table__arabic {
    font-size: clamp(18px, calc(25px * var(--fit-scale)), 25px);
  }

  .i20-table__english {
    font-size: clamp(11px, calc(14px * var(--fit-scale)), 14px);
  }

  .i21-map__branch {
    width: 31%;
  }

  .i21-node {
    padding-inline: calc(5px * var(--fit-scale));
  }

  .i21-node__arabic {
    font-size: clamp(16px, calc(23px * var(--fit-scale)), 23px);
  }
}

:is([data-theme='dark'], .theme-dark, .dark-theme) .slide--i-20,
:is([data-theme='dark'], .theme-dark, .dark-theme) .slide--i-21,
:is([data-theme='dark'], .theme-dark, .dark-theme) .slide--i-22 {
  --info-structure-surface: #222824;
  --info-structure-card: #171b18;
  --info-structure-card-alt: #1d332d;
  --info-structure-border: #46534d;
  --info-structure-line: #65bbaa;
  --info-structure-muted: #bac4bf;
  --info-structure-text: #f4f6f5;
}

:is([data-theme='dark'], .theme-dark, .dark-theme) :is(.slide--i-20, .slide--i-21, .slide--i-22) .slide__title {
  color: var(--info-structure-muted);
}

:is([data-theme='dark'], .theme-dark, .dark-theme) .slide--i-22 {
  --i22-legend-neutral: #b7bdb9;
}

:is([data-theme='dark'], .theme-dark, .dark-theme) .slide--i-22 .i22-tone-2:is(.i22-phrase__part),
:is([data-theme='dark'], .theme-dark, .dark-theme) .slide--i-22 .i22-tone-2 :is(.i22-legend__dot, .i22-legend__arabic) {
  color: var(--i22-legend-neutral);
}

:is([data-theme='dark'], .theme-dark, .dark-theme) .slide--i-22 .i22-tone-3:is(.i22-phrase__part),
:is([data-theme='dark'], .theme-dark, .dark-theme) .slide--i-22 .i22-tone-3 :is(.i22-legend__dot, .i22-legend__arabic) {
  color: #ee6c60;
}

.a1-four-grid {
  grid-row: 1 / -1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--gap-row) * var(--fit-scale));
}

.a1-four-list {
  grid-row: 1 / -1;
  display: grid;
  align-content: center;
  row-gap: calc(8px * var(--fit-scale));
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.a1-four-list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: calc(10px * var(--fit-scale));
  min-height: calc(var(--h-row) * var(--fit-scale));
  padding: calc(8px * var(--fit-scale));
  border-radius: calc(var(--radius) * var(--fit-scale));
  background: var(--ui-panel);
}

.a1-four-list-row__body {
  min-width: 0;
}

.a1-four-list-row .a1-four-card__arabic,
.a1-four-list-row .a1-four-card__translation {
  text-align: center;
}

.a1-reading-text,
.a1-reading-statement {
  grid-row: 1 / -1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(14px * var(--fit-scale));
  border-radius: calc(var(--radius) * var(--fit-scale));
  background: var(--ui-panel);
  font-size: clamp(24px, calc(34px * var(--fit-scale)), 34px);
  line-height: 1.65;
  text-align: right;
}

.slide--rc-1-1 .slide__content,
.slide--rc-1-2 .slide__content,
.slide--rc-1-3 .slide__content,
.slide--rc-2 .slide__content,
.slide--rc-3 .slide__content,
.slide--cs-2 .slide__content {
  max-width: 867px;
}

.slide--cs-2 .a1-reading-statement {
  grid-row: 1 / 4;
  grid-column: 1;
}

.slide--cs-2 .a1-word-bank {
  grid-column: 1;
  padding: 4px;
}

.slide--rc-1-1 .a1-reading-text,
.slide--rc-1-2 .a1-related-fragment,
.slide--rc-1-3 .a1-reading-statement,
.slide--rc-1-3 .a1-related-fragment,
.slide--rc-2 .a1-reading-statement,
.slide--rc-3 .a1-reading-statement,
.slide--cs-2 .a1-reading-statement {
  width: 100%;
  max-width: 100%;
  justify-self: stretch;
  margin-inline: 0;
}

.slide--rc-1-2 .a1-rc-choice-stack,
.slide--rc-1-3 .a1-rc-choice-stack,
.slide--rc-2 .a1-rc-choice-stack,
.slide--rc-3 .a1-rc-choice-stack {
  max-width: 410px;
  justify-self: center;
}

.slide--rc-3 .a1-rc-choice-stack {
  grid-row: 3 / -1;
  grid-template-rows: repeat(2, minmax(calc(var(--h-row) * var(--fit-scale)), max-content));
  align-content: start;
}

.slide--rc-3 .a1-rc-choice-btn {
  height: auto;
  min-width: 0;
  min-height: calc(var(--h-row) * var(--fit-scale));
}

.a1-reading-statement {
  grid-row: 1 / 3;
  align-self: stretch;
  font-size: clamp(22px, calc(30px * var(--fit-scale)), 30px);
}

.a1-reading-statement--text {
  grid-row: 1 / 3;
}

.a1-reading-question {
  grid-row: 3 / 4;
  min-height: calc(var(--h-row) * var(--fit-scale));
  display: grid;
  place-items: center;
  padding: calc(10px * var(--fit-scale));
  border: none;
  border-radius: calc(var(--radius) * var(--fit-scale));
  background: var(--ui-panel);
  direction: var(--tl-dir, rtl);
  font-family: var(--second-family);
  font-size: clamp(22px, calc(30px * var(--fit-scale)), 30px);
  line-height: 1.35;
  text-align: center;
}

.a1-rc-choice-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--gap-row) * var(--fit-scale));
  width: 100%;
}

.a1-rc-choice-stack--binary {
  grid-template-columns: 1fr 1fr;
}

.a1-reveal-link {
  display: inline-flex;
  justify-content: center;
  justify-self: center;
  border: none;
  background: transparent;
  color: var(--main-green);
  font-weight: 600;
  font-size: clamp(12px, calc(15px * var(--fit-scale)), 15px);
  text-decoration: underline;
}

.a1-related-fragment {
  min-height: 0;
  max-height: calc(var(--h-row) * 1.4 * var(--fit-scale));
  overflow-y: auto;
  padding: calc(10px * var(--fit-scale));
  border-radius: calc(var(--radius) * var(--fit-scale));
  background: #eef7fb;
  direction: var(--tl-dir, rtl);
  font-family: var(--second-family);
  font-size: clamp(20px, calc(28px * var(--fit-scale)), 28px);
  line-height: 1.45;
  text-align: right;
}

.a1-dialogue-line {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.slide--rd-2 .a1-dialogue-list {
  grid-auto-rows: max-content;
}

.slide--rd-2 .a1-dialogue-line {
  height: auto;
  min-height: calc(var(--h-row) * var(--fit-scale));
  align-self: start;
}

.a1-dialogue-line--current {
  box-shadow: inset 0 0 0 calc(2px * var(--fit-scale)) color-mix(in srgb, var(--main-green) 22%, transparent);
}

.slide--rd-2 .play-btn:disabled:not(.playing),
.slide--rd-2 .play-btn.disabled {
  cursor: default;
  opacity: 0.45;
}

.a1-dialogue-line--mono {
  grid-template-columns: minmax(0, 1fr) auto;
}

.a1-dialogue-line--mono .a1-dialogue-line__avatar {
  display: none;
}

.a1-dialogue-line__body,
.a1-fill-line__sentence {
  min-width: 0;
}

.a1-dialogue-line__arabic,
.a1-practice-line__text,
.a1-fill-line__sentence {
  font-size: clamp(22px, calc(30px * var(--fit-scale)), 30px);
  line-height: 1.35;
  text-align: right;
}

.a1-dialogue-line__translation {
  margin-top: calc(4px * var(--fit-scale));
  text-align: right;
}

.a1-reading-practice {
  grid-row: 1 / -1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr) auto auto;
  row-gap: calc(var(--gap-row) * var(--fit-scale));
}

.a1-practice-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: calc(8px * var(--fit-scale));
  padding: calc(10px * var(--fit-scale));
  border-radius: calc(var(--radius) * var(--fit-scale));
  background: var(--ui-panel);
}

.a1-practice-line--learner {
  outline: 2px solid var(--green-light);
  outline-offset: -2px;
  background: #f7fffc;
}

.a1-practice-line--learner.a1-practice-line--wrong {
  outline-color: #b8b8b8;
  background: var(--ui-panel);
}

.a1-practice-hidden {
  visibility: hidden;
}

.a1-practice-controls {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  align-items: center;
  gap: calc(10px * var(--fit-scale));
  padding: calc(8px * var(--fit-scale));
  border-radius: calc(var(--radius) * var(--fit-scale));
  background: var(--ui-panel);
}

.a1-practice-replay-label {
  margin-top: calc(-1 * var(--gap-row) * var(--fit-scale));
  color: #9a9a9a;
  font-size: clamp(11px, calc(13px * var(--fit-scale)), 13px);
  text-align: left;
}

.a1-fill-list {
  grid-row: 1 / 4;
}

.slide--rd-4 .slide__content {
  padding-bottom: min(9%, calc(52px * var(--lesson-scale)));
  grid-template-rows: minmax(0, 1fr) auto;
  row-gap: calc(16px * var(--lesson-scale));
}

.slide--rd-4 .a1-fill-list {
  --rd4-portrait-scale: var(--lesson-scale);
  grid-row: 1;
  justify-self: center;
  width: calc(100% + 2 * var(--shell-edge-padding, 0px));
  align-content: safe center;
  gap: calc(28px * var(--lesson-scale));
  padding: calc(3px * var(--lesson-scale)) 0 calc(16px * var(--lesson-scale));
}

.slide--rd-4 .a1-fill-line {
  position: relative;
  display: flex;
  align-items: center;
  width: 93%;
  min-height: calc(72px * var(--rd4-portrait-scale));
  padding: 0 calc(8px * var(--lesson-scale)) 0 calc(20px * var(--lesson-scale));
  gap: calc(6px * var(--lesson-scale));
  direction: ltr;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--ui-panel);
}

.slide--rd-4 .a1-fill-line--right {
  justify-self: end;
  flex-direction: row-reverse;
  padding-inline: calc(8px * var(--lesson-scale)) calc(14px * var(--lesson-scale));
  border-radius: var(--radius) 0 0 var(--radius);
}

.a1-fill-list:has(> li:nth-child(5)) {
  --rd4-portrait-scale: calc(0.82 * var(--lesson-scale));
  row-gap: calc(14px * var(--lesson-scale));
}

.a1-fill-line__speaker {
  position: relative;
  align-self: end;
  flex: none;
}

.a1-fill-line__avatar {
  position: relative;
  width: calc(66px * var(--rd4-portrait-scale));
  height: calc(72px * var(--rd4-portrait-scale));
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: var(--ui-panel);
}

.a1-fill-line__avatar:has(.a1-fill-portrait--m) {
  width: calc(58px * var(--rd4-portrait-scale));
}

:is(#centralFrame, .admin__preview-stage) .a1-fill-portrait {
  max-width: none;
  max-height: none;
  object-fit: fill;
}

.a1-fill-portrait {
  position: absolute;
  mix-blend-mode: multiply;
}

.a1-fill-portrait--m {
  top: 2.94%;
  left: 0;
  width: 100%;
  height: 112.56%;
}

.a1-fill-portrait--f {
  top: -2.11%;
  left: -7.19%;
  width: 107.19%;
  height: 117.25%;
}

.a1-fill-portrait + .a1-character-badge {
  position: relative;
  align-self: start;
  justify-self: start;
  font-size: calc(10px * var(--lesson-scale));
  min-height: 0;
}

.a1-fill-line__avatar--plain-role:has(img) .a1-character-badge {
  position: absolute;
  clip-path: inset(50%);
}

.a1-fill-line__avatar:has(img) .a1-character-badge {
  display: none;
}

.a1-fill-line__speaker .play-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: calc(27px * var(--lesson-scale));
  height: calc(27px * var(--lesson-scale));
  transform: translateY(50%);
}

.a1-fill-line--right .play-btn {
  right: auto;
  left: 0;
}

.slide--rd-4 .a1-fill-line__sentence {
  flex: 1;
  padding-block: calc(4px * var(--lesson-scale));
  font-size: var(--rt-font-size, calc(20px * var(--lesson-scale)));
  font-weight: var(--rt-font-weight, 500);
  line-height: var(--rt-line-height, 1.25);
  text-align: var(--rt-text-align, center);
  overflow-wrap: anywhere;
}

.a1-inline-blank {
  display: inline-flex;
  vertical-align: middle;
  min-width: calc(88px * var(--fit-scale));
  min-height: calc(34px * var(--fit-scale));
  margin-inline: calc(4px * var(--fit-scale));
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--light-yellow);
  border-radius: calc(12px * var(--fit-scale));
  background: #fff;
  color: var(--main-green);
  font-family: var(--second-family);
  font-size: clamp(18px, calc(26px * var(--fit-scale)), 26px);
}

.a1-inline-blank.correct {
  border-color: var(--true-color-light);
  outline: 2px solid var(--true-color-light);
  outline-offset: -1px;
}

.slide--rd-4 .a1-inline-blank {
  min-width: calc(60px * var(--lesson-scale));
  min-height: calc(36px * var(--lesson-scale));
  border-radius: calc(4px * var(--lesson-scale));
  border-color: var(--light-yellow);
}

.slide--rd-4 .a1-inline-blank.drop-target {
  outline: 2px solid var(--main-yellow);
}

.slide--rd-4 .a1-inline-blank.correct {
  display: inline;
  min-width: 0;
  min-height: 0;
  border: 0;
  margin: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  opacity: 1;
}

.slide--rd-4 .a1-fill-line__sentence:has(.a1-inline-blank.correct) {
  color: var(--true-color-light);
}

.slide--rd-4 .a1-fill-line:has(.a1-inline-blank:not(.correct)) .play-btn {
  display: none;
}

.slide--rd-4 .a1-inline-blank.wrong {
  border-color: var(--false-color);
  outline: 2px solid var(--false-color);
  outline-offset: -1px;
}

.a1-word-bank {
  grid-row: 4 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: start;
  gap: calc(8px * var(--fit-scale));
  min-height: 0;
  overflow-y: auto;
}

.slide--rd-4 .a1-word-bank {
  grid-row: 2;
  max-height: calc(132px * var(--lesson-scale));
  padding: calc(8px * var(--lesson-scale));
}

.a1-word-chip,
.a1-selected-word {
  min-height: calc(var(--h-row) * 0.72 * var(--fit-scale));
  padding: 0 calc(14px * var(--fit-scale));
  border: none;
  border-radius: calc(12px * var(--fit-scale));
  background: #fff;
  box-shadow: 0 3px 12px 0 rgba(197, 176, 153, 0.4);
  font-family: var(--second-family);
  font-weight: 500;
  font-size: clamp(18px, calc(25px * var(--fit-scale)), 25px);
  line-height: 1.2;
  direction: var(--tl-dir, rtl);
  color: var(--black);
}

.a1-word-chip--rd4 {
  cursor: grab;
  touch-action: none;
  user-select: none;
  will-change: transform;
}

.a1-word-chip--rd4.is-dragging {
  position: absolute;
  cursor: grabbing;
  box-shadow: 0 5px 16px 0 rgba(120, 105, 88, 0.32);
}

.slide--rd-4 .a1-word-chip-placeholder {
  display: inline-flex;
  min-height: calc(var(--h-row) * 0.72 * var(--fit-scale));
  border-radius: calc(12px * var(--fit-scale));
  background: transparent;
}

.a1-word-chip.wrong,
.a1-sentence-drop.wrong {
  outline: 2px solid var(--false-color);
}

.slide--cs-1 {
  transition: box-shadow 0.6s ease-in-out;
}

.slide--cs-1 .a1-word-chip.reject {
  position: relative;
  transform: translateY(0) scale(1);
  box-shadow: 0 3px 12px 0 rgba(197, 176, 153, 0.4);
  outline: none;
  animation: cs1-word-reject-press 0.48s cubic-bezier(0.25, 0.9, 0.2, 1) both;
  will-change: transform, box-shadow;
}

.slide--cs-1 .a1-word-chip.reject::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: calc(12px * var(--fit-scale));
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(to bottom, #c1c1c1, #f4f4f4) border-box;
  mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  will-change: opacity, transform, filter;
  animation: cs1-word-reject-ring 0.48s cubic-bezier(0.25, 0.9, 0.2, 1) both;
}

.a1-word-chip.correct,
.a1-sentence-drop.correct {
  outline: 2px solid var(--true-color-light);
  color: var(--true-color);
}

.a1-sentence-drop.correct,
.a1-sentence-drop.wrong {
  border-color: transparent;
}

.a1-sentence-drop {
  min-height: calc(var(--h-row) * 1.35 * var(--fit-scale));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: calc(8px * var(--fit-scale));
  padding: calc(10px * var(--fit-scale));
  border: 1px dashed var(--light-yellow);
  border-radius: calc(12px * var(--fit-scale));
  background: transparent;
}

.slide--cs-1 .a1-sentence-drop,
.slide--cs-1 .a1-word-bank--builder {
  direction: var(--tl-dir, rtl);
  unicode-bidi: isolate;
  padding-top: 2px;
}

.a1-sentence-placeholder {
  color: #9a9a9a !important;
  font-size: clamp(12px, calc(15px * var(--fit-scale)), 15px) !important;
  text-align: center;
}

.a1-word-bank--builder {
  grid-row: 4 / -1;
}

/* CS-1.2: the assembly area starts at its usual size and grows with its rows of words,
   so no word crosses its frame. It first fills the free strip below it (rows 2-3), then
   row 3 grows: the free space above the prompt (row 1, which takes all spare height)
   gives way first, down to the prompt's own text; then the word bank (rows 4-5) gets
   shorter and scrolls, down to one row of words. Past that the content overflows and
   initialize.js makes it scroll, kept at its end (.slide__content--scroll). The ::after
   keeps rows 2-3 at their authored height; row 3's intrinsic minimum lets the area take
   space from the others. */
.slide--cs-1-2 .slide__content {
  grid-template-rows:
    auto
    calc((var(--h-row) * 5 * var(--fit-scale) * var(--slide-content-row-2-weight)) / var(--slide-content-rows-sum))
    minmax(min-content, max-content)
    minmax(
      calc(var(--h-row) * 0.72 * var(--fit-scale) + 4px),
      calc((var(--h-row) * 5 * var(--fit-scale) * var(--slide-content-row-4-weight)) / var(--slide-content-rows-sum))
    )
    minmax(0, calc((var(--h-row) * 5 * var(--fit-scale) * var(--slide-content-row-5-weight)) / var(--slide-content-rows-sum)));
}

.slide--cs-1-2 .slide__content--scroll {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}

.slide--cs-1-2 .slide__content::after {
  content: '';
  grid-row: 2 / 4;
  grid-column: 1;
  width: 0;
  height: calc(
    (var(--h-row) * 5 * var(--fit-scale) * (var(--slide-content-row-2-weight) + var(--slide-content-row-3-weight))) / var(--slide-content-rows-sum)
    + var(--gap-row) * var(--fit-scale)
  );
  pointer-events: none;
}

.slide--cs-1-2 .a1-sentence-drop {
  grid-row: 2 / 4;
  grid-column: 1;
  align-self: start;
}

/* Audio, assembly area and word bank stay in place as fragments are picked. */
.slide--cs-1-1 .slide__content {
  padding-bottom: min(12%, calc(58px * var(--lesson-scale)));
  max-width: calc(331px * var(--lesson-scale));
  row-gap: 0;
  grid-template-rows:
    minmax(0, calc(100% * var(--slide-content-row-1-weight) / var(--slide-content-rows-sum)))
    minmax(0, calc(100% * var(--slide-content-row-2-weight) / var(--slide-content-rows-sum)))
    minmax(0, calc(100% * var(--slide-content-row-3-weight) / var(--slide-content-rows-sum)))
    minmax(0, calc(100% * var(--slide-content-row-4-weight) / var(--slide-content-rows-sum)))
    minmax(0, calc(100% * var(--slide-content-row-5-weight) / var(--slide-content-rows-sum)));
}

.slide--cs-1-1 .slide__audio-btn {
  grid-row: 1 / 3;
  width: calc(60px * var(--lesson-scale));
  height: calc(60px * var(--lesson-scale));
}

.slide--cs-1-1 .a1-sentence-drop {
  grid-row: 3;
  align-self: center;
  min-height: 0;
  height: calc(90px * var(--lesson-scale));
  padding: calc(6px * var(--lesson-scale));
  border-color: var(--main-yellow);
  border-radius: calc(8px * var(--lesson-scale));
  overflow: auto;
}

.slide--cs-1-1 .a1-sentence-placeholder {
  font-size: calc(12px * var(--lesson-scale)) !important;
}

.slide--cs-1-1 .a1-assembled {
  font-family: var(--second-family);
  font-size: calc(36px * var(--lesson-scale));
  font-weight: 600;
  text-align: center;
  overflow-wrap: anywhere;
}

.slide--cs-1-1 .a1-assembled:empty {
  display: none;
}

.slide--cs-1-1 .a1-selected-word {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font: inherit;
  direction: inherit;
  cursor: pointer;
}

.slide--cs-1-1 .a1-sentence-drop.correct {
  outline: 0;
  border-color: transparent;
  color: var(--true-color-light);
}

.slide--cs-1-1 .a1-word-bank {
  grid-row: 4 / 6;
  align-content: safe center;
  padding-block: calc(8px * var(--lesson-scale));
}

.slide--cs-1-1 .a1-word-chip,
.a1-word-chip--rd4 {
  min-height: calc(50px * var(--lesson-scale));
  max-width: 100%;
  border-radius: calc(8px * var(--lesson-scale));
  font-size: calc(24px * var(--lesson-scale));
  font-weight: 600;
  overflow-wrap: anywhere;
  box-shadow:
    0 0 1px #0004,
    0 3px 12px #b5b5b566;
}

.slide--cs-1-1 .a1-word-chip:disabled {
  color: #b7b7b7;
  box-shadow: 0 0 1px #0004;
}

.a1-category-grid {
  grid-row: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: center;
  gap: calc(var(--gap-row) * var(--fit-scale));
  width: 100%;
}

.slide--c-8 .a1-category-grid {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  grid-template-rows: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  align-content: stretch;
  align-items: stretch;
}

.slide--c-8 .a1-category-option {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  padding: calc(6px * var(--fit-scale)) calc(10px * var(--fit-scale));
  border: none;
  border-radius: calc(12px * var(--fit-scale));
  background: #fff;
  box-shadow: 0 3px 12px 0 rgba(197, 176, 153, 0.4);
  color: var(--black);
  font-family: inherit;
  font-weight: 500;
  font-size: var(--rt-font-size, clamp(14px, calc(22px * var(--fit-scale)), 22px));
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.2;
}

.slide--c-8 .a1-category-option.correct {
  color: var(--true-color);
  outline: 2px solid var(--true-color-light);
  box-shadow: none;
}

.slide--c-8 .a1-category-option.wrong {
  outline: 2px solid var(--false-color);
  box-shadow: none;
}

@media (max-width: 375px) {
  .a1-compare-grid--two,
  .a1-four-grid,
  .a1-category-grid {
    gap: calc(8px * var(--fit-scale));
  }

  .a1-dialogue-line,
  .a1-fill-line,
  .a1-practice-line {
    gap: calc(6px * var(--fit-scale));
    padding: calc(8px * var(--fit-scale));
  }
}

/* .slide__symbol:has(+ .slide__audio-select-list) {
  grid-row: 1 / 3;
} */

.slide__audio-select-list {
  display: flex;
  flex-direction: column;
  row-gap: calc(var(--gap-row) * var(--fit-scale));
  grid-row: 3 / -1;
}

@media (min-width: 768px) {
  .slide__audio-select-list {
    grid-row: 2 / -1;
  }
}

.slide__audio-select-list-item {
  display: grid;
  grid-template-columns: 64px 140px;
  column-gap: 45px;
  justify-content: center;
  align-items: center;
}

.slide__select-btn {
  height: calc(var(--h-row) * var(--fit-scale));
  box-shadow: 0 3px 12px 0 rgba(197, 176, 153, 0.4);
  background: #fff;
  border-radius: 12px;
  border-radius: calc(12px * var(--fit-scale));
  border: 2px solid transparent;
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 20px;
  text-align: center;
  color: #000;
  transition: opacity 0.5s ease;
}

/* @media (max-device-width: 375px) {
  .slide__select-btn {
    height: 60px;
  }
} */

.slide__select-btn:disabled {
  opacity: 0.5;
}

.slide__audio-select-list-item.correct .slide__select-btn {
  border-color: var(--true-color-light);
  border-width: 2px;
  box-shadow: none;
}

.slide__audio-select-list-item.correct .slide__select-btn:disabled {
  opacity: 1;
}

.slide__audio-select-list-item.wrong .slide__select-btn {
  border-color: var(--false-color);
}

.login-container,
.register-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  height: 100%;
  max-width: 327px;
  max-height: 900px;
  margin: auto;
  overflow-y: scroll;

  scrollbar-color: transparent transparent;
  scrollbar-width: thin;
}

#login-feedback {
  margin-top: 10px;
}

.login-container .logo {
  margin-bottom: 75px;
}

.register-container .logo {
  margin-bottom: 20px;
}

.login-container img,
.register-container img {
  max-width: 100%;
  height: auto;
}

.login-container h2,
.register-container h2 {
  margin: 0;
  margin-bottom: 40px;
  font-weight: 600;
  font-size: 28px;
  line-height: 1.28571;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--ui-text);
}

.login-container p,
.register-container p {
  margin: 0;
  font-size: 14px;
  line-height: 1.42857;
  text-align: center;
  color: var(--ui-text);
}

.login-form,
.register-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.reset-form {
  margin-top: auto;
  flex-grow: 1;
  padding-bottom: 80px;
}

.reset-form .input-group:first-of-type {
  margin-top: auto;
}

.reset-form .input-group:last-of-type {
  margin-bottom: auto;
}

.reset-form .register-button {
  margin-top: auto;
}

.register-form {
  padding-top: 50px;
}

.register-container h2 + p {
  margin: auto;
  text-align: center;
}

.reset-container h2 + p,
.otp-container h2 + p {
  margin-bottom: 0;
  margin-top: 0;
}

.login-form--forgot-password {
  flex-grow: 1;
  justify-content: center;
  padding-top: 40px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  position: relative;
}

.input-group label {
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.42857;
  color: var(--ui-text);
}

.input-group input {
  border: 1px solid #b6b6b6;
  border-radius: 6px;
  width: 100%;
  height: 48px;
  padding: 5px 10px 10px 10px;
  font-family: var(--font-family);
  font-weight: 400;
  font-size: 18px;
  line-height: 1;
  color: var(--ui-text);
}

.input-group input:not(:placeholder-shown):invalid {
  border-color: var(--lb-red);
}

.error-message {
  position: absolute;
  top: 100%;
  color: var(--lb-red);
  font-size: 14px;
  margin-top: 2px;
  display: none;
}

.password-requirements {
  /* position: absolute;
  top: calc(100% + 12px); */
  font-size: 14px;
  color: var(--gray-transcriptions);
  margin-top: 5px;
  padding-top: 10px;
  background-color: #fff;
  z-index: 2;
  width: 100%;
}
.password-requirements li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  list-style: none;
}
.password-requirements li.met {
  color: var(--green-light);
}
.password-requirements li.not-met {
  color: var(--gray-transcriptions);
}

.input-group input::placeholder {
  font-size: 12px;

  line-height: 1.5;
  color: var(--ui-muted-text);
}

.sign-up-with {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  margin-bottom: 10px;
  padding-top: 40px;
}

.sign-up-with__link {
  width: 100%;
  min-height: 48px;
  padding: 11px 20px;
  display: flex;
  align-items: center;
  border-radius: var(--radius);
  background-color: #f5f6f7;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.28571;
  color: var(--ui-text);
  border: none;
  cursor: pointer;
}

.is-not-apple-device .sign-up-with__link--apple {
  display: none;
}

.sign-up-with__link span {
  flex-grow: 1;
  text-align: center;
  padding-right: 25px;
}

.sign-up-with__alternative {
  display: flex;
  justify-content: center;
  position: relative;
  width: 216px;
  margin: 0 auto;
}

.sign-up-with__alternative::before {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: block;
  width: 100%;
  height: 1px;
  background-color: var(--ui-muted-text);
  z-index: -1;
}

.sign-up-with__alternative span {
  padding: 5px;
  background-color: #fff;
  max-width: max-content;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  color: var(--ui-muted-text);
}

.links-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  justify-content: space-between;
  width: 100%;
  padding-top: 15px;
}

.form-checkbox {
  font-size: 14px;
  line-height: 1.28571;
  color: var(--ui-text);
  display: flex;
  align-items: center;
}

.form-checkbox label {
  padding-left: 27px;
  position: relative;
  cursor: pointer;
}

.form-checkbox label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.25 0C1.45507 0 0 1.45507 0 3.25V14.75C0 16.5449 1.45507 18 3.25 18H14.75C16.5449 18 18 16.5449 18 14.75V3.25C18 1.45507 16.5449 0 14.75 0H3.25ZM1.5 3.25C1.5 2.2835 2.2835 1.5 3.25 1.5H14.75C15.7165 1.5 16.5 2.2835 16.5 3.25V14.75C16.5 15.7165 15.7165 16.5 14.75 16.5H3.25C2.2835 16.5 1.5 15.7165 1.5 14.75V3.25Z' fill='%23A3A3A3'/%3E%3C/svg%3E%0A");
  background-repeat: no-repeat;
  background-size: contain;
}

.form-checkbox input:checked + label::before {
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.25 0C1.45507 0 0 1.45507 0 3.25V14.75C0 16.5449 1.45507 18 3.25 18H14.75C16.5449 18 18 16.5449 18 14.75V3.25C18 1.45507 16.5449 0 14.75 0H3.25ZM1.5 3.25C1.5 2.2835 2.2835 1.5 3.25 1.5H14.75C15.7165 1.5 16.5 2.2835 16.5 3.25V14.75C16.5 15.7165 15.7165 16.5 14.75 16.5H3.25C2.2835 16.5 1.5 15.7165 1.5 14.75V3.25ZM14.28 6.28064C14.5731 5.98791 14.5734 5.51304 14.2806 5.21998C13.9879 4.92691 13.513 4.92664 13.22 5.21936L6.99658 11.4356L4.78084 9.21968C4.48795 8.92678 4.01308 8.92677 3.72018 9.21965C3.42727 9.51253 3.42726 9.98741 3.72014 10.2803L6.46591 13.0262C6.75868 13.319 7.23333 13.3192 7.52628 13.0266L14.28 6.28064Z' fill='%2300B98E' /%3E%3C/svg%3E");
}

.reset-password-link {
  margin-left: auto;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.9em;
  color: var(--main-yellow);
  text-decoration: none;
}

.reset-password-link:disabled {
  color: #999999;
  text-decoration: none;
  cursor: not-allowed;
}

.policy-modal button {
  position: absolute;
  right: 0;
  top: 0;
  background-color: transparent;
  border: none;
}

.input-group input:focus {
  outline: 2px solid var(--main-green);
  outline-offset: -1px;
}

.register-link-container,
.login-link-container {
  width: 100%;
  max-width: 300px;
  margin: auto auto 0;
  padding-top: 45px;
  font-size: 14px;
  text-align: center;
  font-size: 14px;
  line-height: 1.28571;
  text-align: right;
  color: var(--ui-text);
}

.policy-group {
  padding-top: 30px;
}

.policy-text {
  max-width: 327px;
  margin: 0 auto;
  font-size: 14px;
  padding-top: 0;
  text-align: left;
  line-height: 1.28571;
  color: var(--ui-text);
}

.legal-links {
  padding-top: 15px;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ui-text);
}

.legal-links a {
  color: inherit;
  text-decoration: underline;
  text-decoration-skip-ink: none;
}

.register-link-container a,
.login-link-container a,
.policy-text a,
.register-link-container button {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-skip-ink: none;
  color: var(--main-green);
}

.login-button,
.register-button,
.verify-button {
  position: relative;
  width: 100%;
  margin-top: 25px;
  border-radius: var(--radius);
  width: 100%;
  max-width: 218px;
  height: 40px;
  background: var(--green-light);
  border: none;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 20px;
  text-align: center;
  color: var(--ui-button-text);
  text-transform: uppercase;
  box-shadow: 0 4px 0 var(--main-green);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.register-button {
  margin-top: 16px;
}

.login-button:active,
.register-button:active,
.verify-button:active {
  background-color: var(--main-green);
}

.login-button:focus-visible,
.register-button:focus-visible,
.verify-button:focus-visible {
  outline: 2px solid var(--main-green);
  outline-offset: 3px;
  box-shadow: 0px 0px 0px 0px var(--main-green);
}

.register-button:disabled,
.login-button:disabled,
.verify-button:disabled {
  background: #9b9b9b;
  box-shadow: 0 4px 0 var(--gray-transcriptions);
  pointer-events: none;
}

.password-container {
  position: relative;
}

.password-actions {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 16px;
}

.password-actions button {
  background-color: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.password-actions button:focus-visible {
  outline-color: var(--main-green);
}

.otp-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  flex-grow: 1;
}

.otp-inputs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  align-items: end;
  flex-grow: 1;
}

.otp-feedback {
  flex-grow: 1;
  display: flex;
  align-items: center;
}

.otp-digit {
  width: 100%;
  height: 70px;
  text-align: center;
  border: 1px solid var(--ui-muted-text);
  border-radius: var(--radius);
  background: #fff;
  transition: all 0.2s ease;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 36px;

  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--ui-text);
}

.otp-digit:focus::placeholder {
  color: var(--green-light);
}

.otp-digit:focus {
  border-color: var(--green-light);
  outline: none;
}

.otp-digit:invalid {
  color: var(--lb-red);
}

.otp-digit.filled {
  color: var(--green-light);
}

.verify-button:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.7;
}

.resend-link {
  background: none;
  border: none;
  color: var(--green-light);
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
}

.resend-link:disabled {
  color: #999;
  cursor: not-allowed;
}

.dropzone-wrapper {
  display: flex;
  gap: 6px;
  gap: calc(6px * var(--fit-scale));
  margin-bottom: auto;
}

@media (max-height: 800px) {
  .login-container .logo {
    height: 60px;
    margin-bottom: 25px;
  }

  .register-link-container,
  .login-link-container {
    padding-top: 25px;
  }
}

.dropzone {
  border: 1px dashed var(--light-yellow);
  border-radius: 12px;
  border-radius: calc(12px * var(--fit-scale));
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone.drop-target {
  border-color: var(--ui-muted-text);
}

.draggables-wrapper {
  display: flex;
  gap: 6px;
}

.draggable {
  width: 66px;
  height: 66px;
  border-radius: 8px;
  border-radius: calc(var(--radius) * var(--fit-scale));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  font-family: var(--second-family);
  font-weight: 400;
  font-size: 36px;
  font-size: clamp(20px, calc(36px * var(--fit-scale)), 36px);
  text-align: center;
  color: #000;
  transition: box-shadow 0.2s;
  box-shadow: 0 3px 12px 0 rgba(197, 176, 153, 0.4);
  background: #fff;
  z-index: 10;
}

@media (max-height: 500px) {
  .draggable {
    border-radius: 2px;
  }
}

.drag-letters-slide-3-col .draggable {
  font-size: 48px;
}

.draggable:active {
  cursor: grabbing;
  box-shadow: 0 3px 14px 0 rgba(197, 176, 153, 0.81);
  outline: 1px solid var(--main-yellow);
  z-index: 10;
}

.draggable.placed {
  cursor: default;
}

.drag-letters-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-grow: 1;
  grid-row: 3 / -1;
}

.drag-letters-slide .slide__media {
  grid-row: 1 / 2;
  justify-self: center;
  align-self: center;
  display: flex;
  justify-content: center;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-width: 0;
}

.drag-letters-slide .drag-letters-container {
  width: 100%;
  min-width: 0;
  justify-self: stretch;
}

.drag-letters-slide-3-col .dropzone {
  width: 110px;
  height: 100px;
}

.drag-letters-container .dropzone {
  width: 66px;
  height: 66px;
  width: calc(66px * var(--fit-scale));
  height: calc(66px * var(--fit-scale));
  position: relative;
  border-radius: 12px;
  border-radius: calc(12px * var(--fit-scale));
}

.drag-letters-container .draggable {
  width: 64px;
  height: 64px;
  width: calc(66px * var(--fit-scale));
  height: calc(66px * var(--fit-scale));
  border-radius: 12px;
  border-radius: calc(12px * var(--fit-scale));
  position: relative;
}

.drag-letters-slide .dropzone-wrapper,
.drag-letters-slide .draggables-wrapper {
  gap: calc(4px * var(--fit-scale));
  width: 100%;
  min-width: 0;
  max-width: 100%;
  justify-content: center;
  transform: translateX(calc(-3px * var(--fit-scale)));
}

.drag-letters-slide .drag-letters-container .dropzone,
.drag-letters-slide .drag-letters-container .draggable,
.drag-letters-slide .draggable-placeholder {
  width: calc(63px * var(--fit-scale));
  height: calc(63px * var(--fit-scale));
  flex: 0 0 calc(63px * var(--fit-scale));
}

/* @media (max-device-width: 375px) {
  .drag-letters-container .draggable {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    font-size: 24px;
  }

  .drag-letters-container .dropzone {
    width: 46px;
    height: 46px;
  }
} */

.drag-letters-container .draggable.wrong {
  color: var(--gray-transcriptions);
  box-shadow: none;
}

.drag-letters-container .dropzone.wrong {
  border-color: var(--gray-transcriptions);
}

.drag-letters-slide-3-col .dropzone {
  width: 110px;
  height: 100px;
}

.drag-letters-slide-3-col .draggable {
  width: 109px;
  height: 98px;
}

.draggable,
.draggable-word,
.draggable-letter {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.dropzone {
  touch-action: none;
}

.slide__words {
  position: relative;
  width: 160px;
  height: 160px;
  width: calc(var(--h-row) * var(--fit-scale) * 2);
  height: calc(var(--h-row) * var(--fit-scale) * 2);
  margin: auto;
  grid-row: 1 / 3;
}
.slide__zones {
  display: grid;
  display: flex;
  justify-content: space-evenly;
  gap: var(--gap);
  grid-row: 3 / -1;
  align-items: flex-end;
}

.slide__zones .dropzone {
  width: 100%;
  height: 164px;
  width: calc(var(--h-row) * var(--fit-scale) * 2 + 4px);
  height: calc(var(--h-row) * var(--fit-scale) * 2 + 4px);
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 22px;
  font-size: clamp(14px, calc(22px * var(--fit-scale)), 22px);
  text-align: center;
  color: var(--gray-transcriptions);
}

@media (min-width: 768px) {
  .slide__zones {
    align-items: center;
  }
}

.slide__zones .dropzone.correct .draggable-word {
  color: var(--true-color);
}

.slide__zones .dropzone.wrong {
  border: 1px solid var(--false-color);
}

.drag-letters-container .draggable.wrong {
  width: calc(64px * var(--fit-scale));
  height: calc(64px * var(--fit-scale));
}

.draggable-word {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 160px;
  height: 160px;

  width: calc(var(--h-row) * var(--fit-scale) * 2);
  height: calc(var(--h-row) * var(--fit-scale) * 2);
  box-shadow: 0 3px 12px 0 rgba(197, 176, 153, 0.4);
  background: #fff;
  border-radius: 12px;
  border-radius: calc(12px * var(--fit-scale));
  transition: border 0.5s ease;
  font-family: var(--second-family);
  font-weight: 400;
  font-size: 36px;
  font-size: clamp(16px, calc(36px * var(--fit-scale)), 36px);
  text-align: center;
  color: #000;
}

/* @media (max-width: 375px) {
  .slide__words {
    width: 120px;
    height: 120px;
  }
  .draggable-word {
    width: 120px;
    height: 120px;
  }

  .slide__zones .dropzone {
    width: 124px;
    height: 124px;
    margin: 0 auto;
    font-size: 16px;
  }
} */

.draggable-word-small {
  font-size: 60px;
}

.slide__forms {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 17px;
  margin: auto 0;
  flex-grow: 2;
}

.slide--c8 .slide__word {
  /* display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: row-reverse;
  gap: 17px; */
  margin: auto 0;
  flex-grow: 1;
  direction: var(--tl-dir, rtl);
  text-align: center;
}

.slide--c8 .slide__word .dropzone {
  width: 76px;
  height: 76px;
  width: calc(76px * var(--fit-scale));
  height: calc(76px * var(--fit-scale));
  display: inline-flex;
  margin-bottom: calc(-22px * var(--fit-scale));
}

.slide__word-wrapper {
  flex-grow: 1;
  margin: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: row-reverse;
  gap: 17px;
  margin: auto 0;
  flex-grow: 1;
  grid-row: 3 / 4;
}

.word-letter {
  /* width: 76px;
  height: 76px;
  border: 1px solid var(--green-light); */
  border-radius: 12px;
  border-radius: calc(12px * var(--fit-scale));
  font-family: var(--second-family);
  font-weight: 400;
  font-size: 36px;
  text-align: center;
  color: #000;
}

.draggable-letter {
  font-family: var(--second-family);
  font-weight: 400;
  font-size: 36px;
  font-size: clamp(20px, calc(36px * var(--fit-scale)), 36px);
  text-align: center;
  color: #000;
  border-radius: 12px;
  border-radius: calc(12px * var(--fit-scale));
  width: 76px;
  height: 76px;
  width: calc(76px * var(--fit-scale));
  height: calc(76px * var(--fit-scale));
  line-height: calc(76px * var(--fit-scale));
  box-shadow: 0 3px 12px 0 rgba(197, 176, 153, 0.4);
  background: #fff;
}

.slide--c8 .slide__word .dropzone.correct {
  font-family: var(--second-family);
  font-weight: 400;
  font-size: 36px;
}

.draggable-letter.correct {
  background-color: transparent;
  box-shadow: none;
}

.slide__answers {
  grid-row: 2 / 5;
  font-family: var(--second-family);
  font-weight: 500;
  font-size: 70px;
  text-align: center;
  color: #000;
}

.slide__word-help-text {
  grid-row: 5 / 6;
  text-align: center;
  font-size: 14px;
  text-align: center;
  color: var(--gray-transcriptions);
}

.slide__answers span {
  cursor: pointer;
  transition: color 0.5s ease;
}

.slide__answers .correct {
  color: var(--true-color-light);
}

.slide__answers .wrong {
  color: var(--false-color);
}

.lesson-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  width: 100%;
}

@media (max-height: 500px) {
  .lesson-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    width: 100%;
  }
}

@media (min-width: 768px) {
  .lesson-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    width: 300px;
    align-self: flex-end;
  }
}

@media (min-width: 1024px) {
  .lesson-progress {
    width: 526px;
  }
}

/* Lesson info badges */
.lesson-info {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--main-green);
  flex: 0 0 auto;
}

.module-badge,
.lesson-badge {
  font-size: 10px;
  color: var(--main-green);
  white-space: nowrap;
  text-transform: uppercase;
}

.lesson-info-separator {
  font-size: 10px;
  color: var(--main-green);
  line-height: 1;
}

/* Progress bar */
.progress-container {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--ui-panel);
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--main-green);
  border-radius: 6px;
  transition: width 0.3s ease;
}

.progress-summary {
  flex: 0 0 auto;
}

.progress-text {
  font-size: 10px;
  color: var(--ui-muted-text);
  min-width: 40px;
  text-align: right;
}

@media (min-width: 768px) {
  .module-badge,
  .lesson-badge,
  .lesson-info-separator,
  .progress-text {
    font-size: 14px;
  }

  .lesson-progress {
    margin: 0;
    margin-bottom: 7px;
  }
}

.svg-wrapper {
  width: 100%;
  height: 100%;
  grid-row: 1 / -1;
  margin: auto;
  background: #fff;
  padding: 20px;
  touch-action: none;
  user-select: none;
  display: flex;
  justify-content: center;
}

.svg-wrapper svg {
  opacity: 0;
  max-width: 100%;
  height: auto;
  margin: auto;
  transform: scale(1.2);
}

/* Fallback before the Quill config style is injected; must match the
   defaults in public/js/shared/quillConfig.js (sizes). Legacy set is px,
   the *-pct set is relative to the rich-text field size. */
.ql-size-small {
  font-size: 18px;
}

.ql-size-medium {
  font-size: 21px;
}

.ql-size-normal {
  font-size: 24px;
}

.ql-size-large {
  font-size: 38px;
}

.ql-size-huge {
  font-size: 48px;
}

.ql-size-small-pct {
  font-size: 75%;
}

.ql-size-medium-pct {
  font-size: 87.5%;
}

.ql-size-large-pct {
  font-size: 160%;
}

.ql-size-huge-pct {
  font-size: 200%;
}

.ql-font-roboto {
  font-family: 'Roboto', sans-serif;
}

.ql-font-noto-sans-arabic {
  font-family: sans-serif;
}

.ql-font-noto-sans-hebrew {
  font-family: sans-serif;
}

.ql-font-hebrew-school {
  font-family: 'LingvoGo Hebrew School', sans-serif;
}

.ql-font-hebrew-natural {
  font-family: 'LingvoGo Hebrew Natural', sans-serif;
}

.ql-font-lingobab-icons {
  font-family: 'LingoBab Icons', 'Roboto', sans-serif;
}

.app-layout--fixed-phone {
  --fit-scale: 1;
  --app-scale: 1;
  --app-stage-width: 430px;
  --app-stage-height: 900px;
  --cell: 90px;
  --gap: 18px;
  --h-header: 90px;
  --h-footer: 85px;
  --h-title: 110px;
  --h-row: 80px;
  --gap-row: 16px;
  --shell-edge-padding: 22px;
  --shell-stack-gap: clamp(8px, calc(12px * var(--fit-scale)), 12px);
  --shell-control-gap: clamp(8px, calc(24px * var(--fit-scale)), 24px);
  --shell-control-height: clamp(32px, calc(45px * var(--fit-scale)), 45px);
  --shell-control-font-size: clamp(14px, calc(20px * var(--fit-scale)), 20px);
  --shell-control-icon-size: clamp(16px, calc(22px * var(--fit-scale)), 22px);
  --shell-control-shadow: clamp(2px, calc(3px * var(--fit-scale)), 3px);
  --shell-progress-margin-top: clamp(8px, calc(20px * var(--fit-scale)), 20px);
  --shell-score-font-size: clamp(12px, calc(17px * var(--fit-scale)), 17px);
  --shell-badge-font-size: clamp(10px, calc(12px * var(--fit-scale)), 12px);
  --shell-toggle-width: clamp(27px, calc(38px * var(--fit-scale)), 38px);
  --shell-toggle-height: clamp(20px, calc(28px * var(--fit-scale)), 28px);
  --shell-icon-height: clamp(24px, calc(29px * var(--fit-scale)), 29px);
  --shell-footer-padding-bottom: clamp(10px, calc(40px * var(--fit-scale)), 40px);
  --shell-stage-media-max-height: 240px;
  --shell-stage-image-text-max-height: 210px;
  --shell-stage-list-max-height: calc(var(--app-stage-height) * 0.5);
  --shell-stage-letter-grid-font-size: calc(var(--app-stage-width) * 0.085);
  --shell-text-wrap-width: 349px;
}

@media (max-width: 767px) {
  .app-layout--fixed-phone {
    --h-footer: calc(var(--shell-control-height) + var(--shell-footer-padding-bottom));
    --shell-footer-padding-bottom: 0px;
  }

  .app-layout--fixed-phone .slide-controls {
    transform: translateY(-20px);
  }
}

body.app-layout--fixed-phone {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #fff;
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
}

body.app-layout--fixed-phone.app-layout--keyboard-open {
  align-items: flex-start;
}

body.app-layout--fixed-phone #appStageWrap {
  flex: 0 0 auto;
  position: relative;
  isolation: isolate;
  width: calc(var(--app-stage-width) * var(--app-scale));
  height: calc(var(--app-stage-height) * var(--app-scale));
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  overflow: hidden;
  touch-action: pan-y;
  overscroll-behavior: none;
}

body[data-app-shell] #app-container {
  opacity: 1;
  transition: opacity 0.08s ease;
}

html.app-bootstrap-pending body[data-app-shell] #app-container,
html.app-entry-data-pending body[data-app-shell='entry'] #app-container,
html.app-stage-transitioning body[data-app-shell] #app-container {
  opacity: 0;
  pointer-events: none;
}

.app-bootstrap-shell {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: clamp(24px, calc(36px * var(--fit-scale)), 36px);
  background:
    radial-gradient(circle at 12% 12%, color-mix(in srgb, var(--light-yellow) 24%, transparent), transparent 32%),
    radial-gradient(circle at 86% 14%, color-mix(in srgb, var(--green-light) 18%, transparent), transparent 28%),
    linear-gradient(180deg, var(--ui-page-background) 0%, #ffffff 54%, var(--ui-panel) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.08s ease;
}

html.app-bootstrap-pending .app-bootstrap-shell,
html.app-entry-data-pending .app-bootstrap-shell,
html.app-stage-transitioning .app-bootstrap-shell {
  padding: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 248, 248, 0.98) 100%);
}

html.app-stage-transitioning .app-bootstrap-shell::after {
  content: none;
  position: absolute;
  left: 50%;
  bottom: clamp(22px, calc(28px * var(--fit-scale)), 28px);
  width: min(148px, 38%);
  height: 6px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

html.app-stage-transitioning .app-bootstrap-shell::before {
  content: none;
  position: absolute;
  left: 50%;
  bottom: clamp(22px, calc(28px * var(--fit-scale)), 28px);
  width: min(148px, 38%);
  height: 6px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.34) 50%, transparent 100%);
  opacity: 0.45;
  animation: app-stage-transition-bar 0.9s ease-in-out infinite;
}

html.app-bootstrap-pending .app-bootstrap-shell__panel,
html.app-entry-data-pending .app-bootstrap-shell__panel,
html.app-stage-transitioning .app-bootstrap-shell__panel {
  display: none;
}

.app-bootstrap-shell__panel {
  width: min(100%, 302px);
  display: grid;
  gap: 14px;
  padding: 24px 22px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 14px 28px rgba(25, 46, 39, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
}

.app-bootstrap-shell__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(34, 60, 55, 0.74);
}

.app-bootstrap-shell__eyebrow::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--light-yellow), var(--main-green));
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--green-light) 8%, transparent);
}

.app-bootstrap-shell__title {
  color: var(--ui-text);
  font-size: clamp(24px, calc(28px * var(--fit-scale)), 28px);
  font-weight: 500;
  line-height: 1.06;
}

.app-bootstrap-shell__subtitle {
  color: rgba(35, 54, 50, 0.72);
  font-size: 15px;
  line-height: 1.45;
}

.app-bootstrap-shell__title,
.app-bootstrap-shell__subtitle,
.app-bootstrap-shell__eyebrow,
.app-bootstrap-shell__meter,
.app-bootstrap-shell__chips {
  display: none !important;
}

.app-bootstrap-shell__meter {
  position: relative;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--main-green) 12%, transparent);
}

.app-bootstrap-shell__meter::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 -42%;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--light-yellow) 92%, transparent),
    color-mix(in srgb, var(--green-light) 96%, transparent)
  );
  box-shadow: 0 0 18px color-mix(in srgb, var(--green-light) 22%, transparent);
  animation: app-bootstrap-shell-meter 1.2s ease-in-out infinite;
}

.app-bootstrap-shell__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-bootstrap-shell__chip {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(248, 244, 235, 0.92);
  color: rgba(35, 54, 50, 0.78);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

html.app-bootstrap-pending .app-bootstrap-shell,
html.app-entry-data-pending .app-bootstrap-shell,
html.app-stage-transitioning .app-bootstrap-shell {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

@keyframes app-bootstrap-shell-meter {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(340%);
  }
}

@keyframes app-stage-transition-bar {
  0% {
    clip-path: inset(0 100% 0 0 round 999px);
  }

  50% {
    clip-path: inset(0 22% 0 0 round 999px);
  }

  100% {
    clip-path: inset(0 0 0 78% round 999px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shake {
  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }
  20%,
  80% {
    transform: translate3d(1px, 0, 0);
  }
  30%,
  50%,
  70% {
    transform: translate3d(-2px, 0, 0);
  }
  40%,
  60% {
    transform: translate3d(2px, 0, 0);
  }
}

@keyframes shake2 {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  35% {
    transform: translate3d(-2px, 0, 0);
  }
  70% {
    transform: translate3d(1px, 0, 0);
  }
}

@keyframes cs1-word-reject-press {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 3px 12px 0 rgba(197, 176, 153, 0.4);
  }
  18% {
    transform: translateY(1px) scale(0.985);
    box-shadow: 0 2px 8px 0 rgba(197, 176, 153, 0.28);
  }
  35% {
    transform: translateY(2px) scale(0.96);
    box-shadow: 0 1px 3px 0 rgba(197, 176, 153, 0.12);
  }
  52% {
    transform: translateY(2px) scale(0.96);
    box-shadow: 0 1px 3px 0 rgba(197, 176, 153, 0.12);
  }
  76% {
    transform: translateY(0.75px) scale(0.985);
    box-shadow: 0 2px 7px 0 rgba(197, 176, 153, 0.26);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 3px 12px 0 rgba(197, 176, 153, 0.4);
  }
}

@keyframes cs1-word-reject-ring {
  0% {
    opacity: 0;
    transform: scale(0.98);
    filter: blur(1px);
  }
  25% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.015);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-bootstrap-shell,
  .app-bootstrap-shell__meter::after,
  html.app-stage-transitioning .app-bootstrap-shell::before {
    transition: none;
    animation: none;
  }

  .app-bootstrap-shell__meter::after {
    width: 100%;
    inset: 0;
    transform: none;
  }
}

body.app-layout--fixed-phone #app-container {
  width: var(--app-stage-width);
  height: var(--app-stage-height);
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-rows: var(--h-header) minmax(0, 1fr) var(--h-footer);
  background: #fff;
  border-radius: 0;
  overflow: hidden;
  transform: scale(var(--app-scale));
  transform-origin: top left;
}

body.app-layout--fixed-phone #appBuildBadge {
  display: none !important;
}

@media (min-width: 768px) {
  body.app-layout--fixed-phone {
    background-color: rgb(44, 76, 76);
  }

  body.app-layout--fixed-phone #appStageWrap {
    border-radius: calc(40px * var(--app-scale));
    box-shadow: 0 calc(18px * var(--app-scale)) calc(40px * var(--app-scale)) rgba(25, 46, 39, 0.08);
  }

  body.app-layout--fixed-phone #app-container {
    border-radius: 40px;
  }

  body.app-layout--fixed-phone #appBuildBadge {
    display: block !important;
  }

  .app-layout--fixed-phone .module-badge,
  .app-layout--fixed-phone .lesson-badge {
    display: inline;
  }
}

.app-layout--fixed-phone .header {
  max-width: var(--app-stage-width);
  margin: 0 auto;
  display: block;
  padding-top: clamp(12px, calc(16px * var(--fit-scale)), 16px);
  padding-left: 0;
  padding-right: 0;
  padding-bottom: clamp(8px, calc(10px * var(--fit-scale)), 10px);
}

.app-layout--fixed-phone .footer {
  max-width: var(--app-stage-width);
  margin: 0 auto;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
}

.app-layout--fixed-phone .header__logo {
  display: none;
}

.app-layout--fixed-phone .header__nav {
  width: 100%;
  box-sizing: border-box;
  position: static;
  top: auto;
  right: auto;
  margin: 0;
  padding-left: var(--shell-edge-padding);
  padding-right: var(--shell-edge-padding);
  flex-direction: row;
  gap: var(--shell-stack-gap);
}

.header__ai svg {
  fill: none;
}

.header__bookmark a[aria-disabled='true'] {
  filter: grayscale(1);
  pointer-events: none;
}

.header__bookmark a[aria-disabled='false'] {
  filter: none;
  pointer-events: auto;
}

.app-layout--fixed-phone .header__score,
.app-layout--fixed-phone .header__bookmark,
.app-layout--fixed-phone .header__ai,
.app-layout--fixed-phone .nav__toggle,
.app-layout--fixed-phone .lesson-info {
  order: 0;
}

.app-layout--fixed-phone .header__score,
.app-layout--fixed-phone .header__bookmark,
.app-layout--fixed-phone .header__ai {
  flex-direction: row;
}

.app-layout--fixed-phone .header__score {
  gap: clamp(4px, calc(5px * var(--fit-scale)), 5px);
}

.app-layout--fixed-phone .header__score span {
  font-size: var(--shell-score-font-size);
  min-height: clamp(22px, calc(28px * var(--fit-scale)), 28px);
  height: auto;
  padding-left: clamp(4px, calc(5px * var(--fit-scale)), 5px);
  padding-right: clamp(4px, calc(5px * var(--fit-scale)), 5px);
}

.app-layout--fixed-phone .header__score img,
.app-layout--fixed-phone .header__bookmark svg,
.app-layout--fixed-phone .header__ai img {
  height: var(--shell-icon-height);
  width: auto;
}

.app-layout--fixed-phone .nav__toggle {
  width: var(--shell-toggle-width);
  height: var(--shell-toggle-height);
}

.app-layout--fixed-phone #centralFrame {
  padding: calc(20px * var(--fit-scale)) 0 calc(40px * var(--fit-scale));
  overflow: hidden;
}

.app-layout--fixed-phone .learner-live-badges {
  left: 50%;
  bottom: 0px;
  transform: translateX(-50%);
  align-items: flex-end;
  width: calc(100% - (var(--shell-edge-padding) * 2));
  max-width: calc(100% - (var(--shell-edge-padding) * 2));
  padding: 0 calc(8px * var(--fit-scale));
  gap: 6px;
}

.app-layout--fixed-phone .learner-live-coords-badge {
  min-height: auto;
  font-size: clamp(8px, calc(9px * var(--fit-scale)), 9px);
  margin-bottom: calc(6px * var(--fit-scale));
}

.app-layout--fixed-phone .learner-live-carousel-badge {
  min-height: auto;
  font-size: clamp(9.6px, calc(11px * var(--fit-scale)), 11px);
  padding: calc(2px * var(--fit-scale)) calc(8px * var(--fit-scale));
}

.app-layout--fixed-phone .slide {
  padding-left: var(--shell-edge-padding);
  padding-right: var(--shell-edge-padding);
}

.app-layout--fixed-phone .slide__title {
  width: auto;
  max-width: none;
  margin: 0;
}

.app-layout--fixed-phone .slide__title,
.app-layout--fixed-phone .slide__text-content {
  width: min(100%, var(--shell-text-wrap-width));
  max-width: var(--shell-text-wrap-width);
  margin-left: auto;
  margin-right: auto;
}

.app-layout--fixed-phone .slide__title--vertical-centered {
  grid-row: 1 / -1;
  height: 100%;
  margin: auto;
  align-items: center;
  justify-content: center;
}

.app-layout--fixed-phone .slide-controls {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding-left: var(--shell-edge-padding);
  padding-right: var(--shell-edge-padding);
  gap: var(--shell-control-gap);
  padding-bottom: var(--shell-footer-padding-bottom);
}

.app-layout--fixed-phone .slide-controls__btn {
  font-size: var(--shell-control-font-size);
  height: var(--shell-control-height);
  justify-content: center;
  /* box-shadow: 0 var(--shell-control-shadow) 0 var(--main-yellow); */
}

.app-layout--fixed-phone .slide-controls__btn--prev {
  /* width: auto; */
  /* flex: 0 0 clamp(56px, 20.4%, 80px); */
  min-width: 0;
  background-position: center;
  background-size: var(--shell-control-icon-size);
  /* box-shadow: 0 var(--shell-control-shadow) 0 var(--main-yellow); */
}

.app-layout--fixed-phone .slide-controls__btn--next,
.app-layout--fixed-phone .slide-controls__btn--skip {
  /* flex: 1 1 0; */
  min-width: 0;
  /* padding-left: var(--shell-edge-padding);
  padding-right: calc(var(--shell-control-icon-size) + var(--shell-edge-padding));
  background-size: var(--shell-control-icon-size);
  background-position-x: calc(100% - var(--shell-edge-padding)); */
}

.app-layout--fixed-phone .slide-controls__btn--next {
  flex: 1;
  box-shadow: 0 var(--shell-control-shadow) 0 var(--ui-button-shadow, var(--main-green));
}

/* .app-layout--fixed-phone .slide-controls__btn--prev::after {
  content: none;
} */

.app-layout--fixed-phone .lesson-progress {
  display: flex;
  gap: var(--shell-stack-gap);
  margin-top: var(--shell-progress-margin-top);
  width: 100%;
  box-sizing: border-box;
  padding-left: var(--shell-edge-padding);
  padding-right: var(--shell-edge-padding);
}

.app-layout--fixed-phone .progress-container {
  gap: clamp(6px, calc(8px * var(--fit-scale)), 8px);
}

.app-layout--fixed-phone .progress-bar {
  height: clamp(4px, calc(6px * var(--fit-scale)), 6px);
}

.app-layout--fixed-phone .progress-text,
.app-layout--fixed-phone .module-badge,
.app-layout--fixed-phone .lesson-badge,
.app-layout--fixed-phone .lesson-info-separator {
  font-size: var(--shell-badge-font-size);
}

.app-layout--fixed-phone .progress-text {
  min-width: clamp(44px, calc(58px * var(--fit-scale)), 58px);
}

.app-layout--fixed-phone .slide__audio-select-list {
  grid-row: auto;
}

.app-layout--fixed-phone .slide__zones {
  align-items: stretch;
}

.app-layout--fixed-phone #centralFrame img,
.app-layout--fixed-phone #centralFrame video,
.app-layout--fixed-phone #centralFrame audio,
.app-layout--fixed-phone .slide__image {
  max-height: var(--shell-stage-media-max-height);
}

.app-layout--fixed-phone #centralFrame .slide--i-5 .slide__image,
.app-layout--fixed-phone .slide--i-5 .slide__image {
  max-height: 90%;
}

.app-layout--fixed-phone .slide__letters-grid-btn {
  font-size: var(--shell-stage-letter-grid-font-size);
}

.app-layout--fixed-phone .slide__image + .slide__text-content {
  max-height: var(--shell-stage-image-text-max-height);
}

.app-layout--fixed-phone .slide__list:not(.slide__list--audio) {
  max-height: var(--shell-stage-list-max-height);
}

.app-layout--fixed-phone .slide__list--long li {
  min-height: 80px;
}

.app-layout--fixed-phone .lesson-progress {
  align-self: auto;
}

/* Shared Quill content rendering for saved HTML outside the editor UI. */

.rt-richtext {
  --fit-scale: 1;
  color: var(--rt-color, inherit);
  direction: var(--rt-direction, inherit);
  font-family: var(--rt-font-family, inherit);
  font-size: var(--rt-font-size, inherit);
  font-weight: var(--rt-font-weight, inherit);
  justify-self: var(--rt-justify-self, auto);
  letter-spacing: var(--rt-letter-spacing, inherit);
  line-height: var(--rt-line-height, inherit);
  margin-inline: var(--rt-margin-inline, 0);
  text-align: var(--rt-text-align, inherit);
}

:where(.rt-preset-title) {
  --rt-line-height: 1.15;
}

:where(.rt-preset-note) {
  --rt-note-border-color: var(--rt-color-token-accent, currentColor);
}

:where(.quill-content, .ql-editor) :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6) {
  margin: 0;
  padding: 0;
  color: inherit;
  direction: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: inherit;
}

:where(.quill-content, .ql-editor) :is(ol, ul) {
  padding-inline-start: 1.5em;
}

:where(.quill-content, .ql-editor) li {
  margin: 0;
}

:where(.quill-content, .ql-editor) li[data-rt-list-kind='checked']::marker {
  content: '[x] ';
}

:where(.quill-content, .ql-editor) li[data-rt-list-kind='unchecked']::marker {
  content: '[ ] ';
}

/* Saved Quill blocks should keep tight editor-like spacing inside actual rich-text wrappers. */
:where(.slide [data-field]:has(> :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6)))
  > :is(p, ol, ul, pre, blockquote) {
  margin: 0;
  padding: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: inherit;
}

:where(.slide [data-field]:has(> :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6)))
  > :is(h1, h2, h3, h4, h5, h6) {
  margin: 0;
  padding: 0;
  color: inherit;
  font-family: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: inherit;
}

.slide__title:has(> :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6)) {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  justify-self: center;
}

.slide__content .slide__title:has(> :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6)) {
  margin: 0 auto;
}

.slide__content .slide__title.rt-richtext {
  color: var(--rt-color, inherit);
  direction: var(--rt-direction, inherit);
  font-family: var(--rt-font-family, inherit);
  font-size: var(--rt-font-size, inherit);
  font-weight: var(--rt-font-weight, inherit);
  letter-spacing: var(--rt-letter-spacing, inherit);
  line-height: var(--rt-line-height, inherit);
  text-align: var(--rt-text-align, inherit);
}

:where(
    .slide__title:not(.rt-richtext):not(.rt-richtext--role-title):has(
        > :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6)
      )
  )
  > :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6) {
  text-align: start;
}

:where(.slide__title.rt-richtext--role-title[data-tl]:has(> :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6)))
  > :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6) {
  direction: var(--tl-dir, rtl);
}

:where(
    .slide__title:not(.rt-richtext):not(.rt-richtext--role-title)[data-tl]:has(
        > :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6)
      )
  )
  > :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6) {
  direction: var(--tl-dir, rtl);
  text-align: start;
}

:where(.slide__symbol:has(> :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6)))
  > :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6) {
  font-family: 'Roboto', var(--second-family), sans-serif;
  color: inherit;
  direction: initial;
}

/* Rich-text heroes follow the configured direction on the wrapper in every locale;
   the `initial` reset above would otherwise push trailing punctuation to the right. */
:where(.slide__symbol.rt-richtext:has(> :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6)))
  > :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6) {
  direction: inherit;
}

.slide--pr1
  .slide__phrase.rt-richtext:has(> :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6))
  > :is(p, ol, ul, pre, blockquote, h1, h2, h3, h4, h5, h6) {
  font-family: inherit;
  color: inherit;
  direction: inherit;
  text-align: inherit;
}

.slide--pr1 .slide__phrase :is(.exact-match, .quasi-match, .no-match) {
  -webkit-text-fill-color: currentColor;
}

:where(.quill-content, .ql-editor) .rt-inline-term {
  font-weight: var(--rt-term-font-weight, 700);
  letter-spacing: var(--rt-term-letter-spacing, 0.02em);
}

:where(.quill-content, .ql-editor) .rt-weight-normal {
  font-weight: 400;
}

:where(.quill-content, .ql-editor) .rt-weight-semibold {
  font-weight: 500;
}

:where(.quill-content, .ql-editor) .rt-weight-bold {
  font-weight: 700;
}

:where(.quill-content, .ql-editor) .rt-tone-accent {
  color: var(--rt-color-token-accent, currentColor);
}

:where(.quill-content, .ql-editor) .rt-block-note {
  border-inline-start: 0.22em solid var(--rt-note-border-color, currentColor);
  color: var(--rt-note-color, inherit);
  display: block;
  padding-inline-start: 0.8em;
}

[data-tl] {
  unicode-bidi: isolate;
}

/* ==========================================================================
   Slide orientation: landscape stage (900×430) + phone "rotate device" overlay.
   Driven by public/js/shared/slideOrientation.js. The class goes on the element
   that carries the stage vars: <body> in the learner, .admin__preview-shell in the
   editor. Only slides with orientation = landscape (I-1, I-2, I-4, I-9, WR-1) are
   ever rendered here, so the generic .slide rules below cannot leak into other types.
   ========================================================================== */

.app-layout--fixed-phone.app-stage--landscape {
  --app-stage-width: 900px;
  --app-stage-height: 430px;
  --h-header: 60px;
  --h-footer: 66px;
  --h-title: 40px;
  --gap-row: 10px;
  --shell-edge-padding: 28px;
  --shell-progress-margin-top: 0px;
  --shell-footer-padding-bottom: 0px;
  --shell-text-wrap-width: 760px;
  --shell-stage-media-max-height: 100%;
  --shell-stage-image-text-max-height: 100%;
}

/* learn-critical.css sizes the stage with literal 430/900; follow the vars instead. */
body.app-layout--fixed-phone.app-stage--landscape #appStageWrap {
  width: calc(var(--app-stage-width) * var(--app-scale));
  height: calc(var(--app-stage-height) * var(--app-scale));
}

/* --- Header: one row — score · progress · AI · bookmark · home --- */
.app-layout--fixed-phone.app-stage--landscape .header {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 18px;
  max-width: none;
  height: var(--h-header);
  padding: 0 var(--shell-edge-padding);
}

.app-layout--fixed-phone.app-stage--landscape .header__nav {
  display: contents;
}

.app-layout--fixed-phone.app-stage--landscape .header__score {
  order: 1;
}

.app-layout--fixed-phone.app-stage--landscape .lesson-progress {
  order: 2;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  margin: 0;
  padding: 0 8px;
  align-self: center;
}

.app-layout--fixed-phone.app-stage--landscape .header__ai {
  order: 3;
}

.app-layout--fixed-phone.app-stage--landscape .header__bookmark {
  order: 4;
}

.app-layout--fixed-phone.app-stage--landscape .nav__toggle {
  order: 5;
}

/* --- Footer: controls centred, not stretched across 900px --- */
.app-layout--fixed-phone.app-stage--landscape .footer {
  max-width: none;
}

.app-layout--fixed-phone.app-stage--landscape .slide-controls {
  max-width: 520px;
  margin: 0 auto;
  padding-top: 4px;
  align-items: flex-start;
}

.app-layout--fixed-phone.app-stage--landscape .slide-controls__btn {
  height: 42px;
}

.app-layout--fixed-phone.app-stage--landscape .slide-controls__btn--prev,
.app-layout--fixed-phone.app-stage--landscape .slide-controls__btn--skip {
  height: 24px;
  margin-top: 4px;
}

/* --- Slide frame --- */
.app-layout--fixed-phone.app-stage--landscape #centralFrame {
  padding: 4px 0 8px;
}

.app-layout--fixed-phone.app-stage--landscape .slide {
  grid-template-rows: var(--h-title) minmax(0, 1fr);
  row-gap: var(--gap-row);
}

.app-layout--fixed-phone.app-stage--landscape .slide__title {
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-layout--fixed-phone.app-stage--landscape .slide__title:not(.rt-richtext) {
  font-size: 22px;
}

.app-layout--fixed-phone.app-stage--landscape .slide__title--vertical-centered {
  grid-row: 1 / -1;
  flex-direction: column;
}

.app-layout--fixed-phone.app-stage--landscape .slide__title--vertical-centered:not(.rt-richtext) {
  font-size: 28px;
}

/* One full-height row; the authoring content-grid row weights are a portrait concept. */
.app-layout--fixed-phone.app-stage--landscape .slide__content {
  display: grid;
  flex-direction: initial;
  max-width: none;
  height: 100%;
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  row-gap: 0;
  column-gap: 32px;
  align-items: center;
  transform: none;
}

/* --- I-2 / I-4: media left, text right (I-4 "image down" = media right) --- */
.app-layout--fixed-phone.app-stage--landscape .slide__content:has(.slide__image):has(.slide__text-content) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.app-layout--fixed-phone.app-stage--landscape .slide__content > .slide__image,
.app-layout--fixed-phone.app-stage--landscape #centralFrame .slide__content > .slide__image {
  grid-row: 1;
  grid-column: 1;
  width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
  justify-self: center;
}

.app-layout--fixed-phone.app-stage--landscape .slide__content > .slide__text-content {
  grid-row: 1;
  grid-column: 1;
  width: 100%;
  max-width: var(--shell-text-wrap-width);
  max-height: 100%;
  margin: 0 auto;
  align-self: center;
  order: 0;
}

.app-layout--fixed-phone.app-stage--landscape .slide__image + .slide__text-content {
  grid-column: 2;
  max-height: 100%;
  font-size: var(--rt-font-size, 20px);
}

.app-layout--fixed-phone.app-stage--landscape .slide--i-4-image-down .slide__image + .slide__text-content {
  grid-column: 1;
}

.app-layout--fixed-phone.app-stage--landscape .slide--i-4-image-down .slide__content > .slide__image,
.app-layout--fixed-phone.app-stage--landscape #centralFrame .slide--i-4-image-down .slide__content > .slide__image {
  grid-column: 2;
  margin: 0;
}

/* --- I-9: video fills the height, controls float over its bottom edge --- */
.app-layout--fixed-phone.app-stage--landscape .slide--video .video-player {
  position: relative;
  grid-row: 1;
  width: auto;
  max-width: 100%;
  height: 100%;
  margin: 0 auto;
  display: block;
}

.app-layout--fixed-phone.app-stage--landscape #centralFrame .slide--video .video-player__video {
  display: block;
  width: auto;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0 !important;
  border-radius: 16px;
  background: #000;
}

.app-layout--fixed-phone.app-stage--landscape .slide--video .video-player__controls {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  width: auto;
  margin: 0;
}

.app-layout--fixed-phone.app-stage--landscape .slide--video .video-player__play-btn {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
}

.app-layout--fixed-phone.app-stage--landscape .slide--video .video-player__play-btn svg {
  width: 100%;
  height: 100%;
}

/* --- WR-1: the word uses the whole width --- */
.app-layout--fixed-phone.app-stage--landscape .slide--wr-1 .svg-wrapper {
  grid-row: 1;
  height: 100%;
  padding: 8px 24px;
}

.app-layout--fixed-phone.app-stage--landscape .slide--wr-1 .svg-wrapper svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  transform: none;
}

/* --- Phone: "rotate your device" overlay --- */
.orientation-guard {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: #fff;
  text-align: center;
  font-family: 'Roboto', sans-serif;
  touch-action: none;
  overscroll-behavior: none;
}

.orientation-guard[hidden] {
  display: none;
}

.orientation-guard__icon {
  width: 96px;
  height: 96px;
  margin-bottom: 8px;
  animation: orientation-guard-to-landscape 2.4s ease-in-out infinite;
}

.orientation-guard[data-target='portrait'] .orientation-guard__icon {
  animation-name: orientation-guard-to-portrait;
}

.orientation-guard__title {
  margin: 0;
  max-width: 320px;
  color: var(--ui-text);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
}

.orientation-guard__hint {
  margin: 0;
  max-width: 320px;
  color: var(--ui-muted-text);
  font-size: 15px;
  line-height: 1.4;
}

@keyframes orientation-guard-to-landscape {
  0%,
  20% {
    transform: rotate(0deg);
  }
  55%,
  100% {
    transform: rotate(-90deg);
  }
}

@keyframes orientation-guard-to-portrait {
  0%,
  20% {
    transform: rotate(-90deg);
  }
  55%,
  100% {
    transform: rotate(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .orientation-guard__icon {
    animation: none;
    transform: rotate(0deg);
  }
}

html.app-orientation-blocked,
html.app-orientation-blocked body {
  overflow: hidden;
}

/* Learner: the message sits over the slide row only (between header and footer),
   so a learner who cannot rotate can still use the nav buttons to move on. */
.orientation-guard--in-frame {
  position: absolute;
  inset: auto;
  top: var(--h-header);
  bottom: var(--h-footer);
  left: 0;
  right: 0;
  z-index: 6;
  padding: 16px 28px;
  gap: 12px;
}

.app-stage--landscape .orientation-guard--in-frame {
  gap: 8px;
}

.app-stage--landscape .orientation-guard--in-frame .orientation-guard__icon {
  width: 72px;
  height: 72px;
  margin-bottom: 4px;
}

.app-stage--landscape .orientation-guard--in-frame .orientation-guard__title,
.app-stage--landscape .orientation-guard--in-frame .orientation-guard__hint {
  max-width: 520px;
}

/* Keep header and nav buttons above the message (on phones the buttons are shifted up
   into the slide row by .slide-controls' translateY). */
html.app-orientation-blocked #app-container > .header,
html.app-orientation-blocked #app-container > .footer {
  position: relative;
  z-index: 7;
}

/* WR-1 without a title: the title row is dropped and .slide__content takes the whole
   slide grid (portrait and landscape, learner and admin preview). */
.slide.slide--wr-1.slide--no-title,
.app-layout--fixed-phone .slide.slide--wr-1.slide--no-title,
.app-layout--fixed-phone.app-stage--landscape .slide.slide--wr-1.slide--no-title {
  grid-template-rows: minmax(0, 1fr);
  row-gap: 0;
}

.slide.slide--wr-1.slide--no-title > .slide__content {
  grid-row: 1 / -1;
  align-content: center;
}

/* ==========================================================================
   Phones held sideways. A landscape phone is often ≥768px wide, which used to switch
   on the desktop look (green page, rounded/shadowed stage). Short + touch = phone:
   keep the mobile look. Tablets in landscape are ≥600px tall and keep the desktop look.
   ========================================================================== */
@media (min-width: 768px) and (max-height: 599px) and (pointer: coarse) {
  body.app-layout--fixed-phone {
    background-color: #fff;
  }

  body.app-layout--fixed-phone #appStageWrap,
  body.app-layout--fixed-phone #app-container,
  body.app-layout--fixed-phone .app-bootstrap-shell {
    border-radius: 0;
    box-shadow: none;
  }

  body.app-layout--fixed-phone #appBuildBadge {
    display: none !important;
  }
}

/* No page scroll in the lesson, in any orientation: the stage is always fitted to the
   viewport (overrides the legacy `@media (orientation: landscape) { body { overflow: auto } }`).
   Without this a stroke on WR-1 could drag the page instead of drawing. */
/* Separate rules on purpose: a browser without :has() would drop a combined selector list. */
html.app-page-scroll-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

html:has(body.app-layout--fixed-phone[data-app-shell='learn']) {
  overflow: hidden;
  overscroll-behavior: none;
}

body.app-layout--fixed-phone[data-app-shell='learn'] {
  overflow: hidden;
  overscroll-behavior: none;
}

/* Landscape slides have no text inputs, so the page can be pinned: this also stops the
   iOS rubber-band / address-bar scroll that interrupts tracing. */
body.app-layout--fixed-phone[data-app-shell='learn'].app-stage--landscape {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
}

/* Tracing slide: no browser panning anywhere on the slide, not only on the SVG itself. */
.slide--wr-1,
.slide--wr-1 .slide__content {
  touch-action: none;
  overscroll-behavior: none;
}

/* Interface colours are configured by profile.json ui. */
body.app-layout--fixed-phone {
  background-color: var(--ui-page-background);
}
.slide-controls__btn--next {
  color: var(--ui-button-text);
}

/* Navigation glyphs use masks; their labels remain ordinary themed text. */
.header__score .header__steps-icon {
  display: block;
  width: 19px;
  height: 31px;
  flex: 0 0 19px;
  background-color: var(--ui-top-bar-icon, var(--ui-icon, var(--light-yellow)));
  -webkit-mask: url('../assets/images/system/icons/man.svg') center / contain no-repeat;
  mask: url('../assets/images/system/icons/man.svg') center / contain no-repeat;
}
.slide-controls__btn--prev,
.slide-controls__btn--skip {
  background-image: none;
}
.slide-controls__btn--prev::before,
.slide-controls__btn--skip::before {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 16px;
  background-color: var(--ui-icon, var(--light-yellow));
  -webkit-mask: var(--control-glyph) center / contain no-repeat;
  mask: var(--control-glyph) center / contain no-repeat;
}
.slide-controls__btn--prev {
  --control-glyph: url('../assets/images/system/icons/prev-new.svg');
}
.slide-controls__btn--skip {
  --control-glyph: url('../assets/images/system/icons/skip-new.svg');
}
.slide-controls__btn--prev::after,
.slide-controls__btn--skip::after {
  color: var(--ui-muted-text);
}

/* External SVG symbols inherit this paint from their host element. */
.header__ai .icon,
.header__bookmark .icon,
.nav__toggle--return .icon {
  color: var(--ui-top-bar-icon, var(--ui-icon, var(--light-yellow)));
}
