/* Обучение: страница курса и кабинет ученика. Токены и базовые компоненты — из site.css, система DESIGN.md.
   Кабинет рабочий и спокойный: чёрный только у плеера и верхней полосы, скругления 16 и 24, синий — главное действие. */

/* ——— Страница курса ——— */
.ob-hero__t { font-family: var(--display); font-weight: 500; letter-spacing: -.01em; }
.ob-hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.ob-facts.sec.sec--black { padding-block: clamp(36px, 5vw, 64px); }
.ob-spec { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; padding: 0; list-style: none; }
.ob-spec b { display: block; font-family: var(--display); font-size: clamp(22px, 2.6vw, 38px); font-weight: 500; line-height: 1.15; letter-spacing: -.03em; color: var(--white); }
.ob-spec span { display: block; margin-top: 8px; font-size: 15px; line-height: 1.35; color: var(--on-dark-2); }

.ob-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 20px; margin: 0; padding: 0; list-style: none; }
.ob-item { min-width: 0; }
.ob-item .lposter { width: 100%; }
.ob-item__meta { margin: 14px 0 6px; font-size: 14px; color: var(--muted); }
.ob-item h3 { font-family: var(--display); font-size: 19px; font-weight: 500; line-height: 1.25; letter-spacing: -.02em; }
.ob-item__desc { margin: 8px 0 0; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }

.ob-how { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 6vw, 88px); }
.ob-who { margin: 0 0 28px; padding: 0; list-style: none; }
.ob-who li { padding: 14px 0; border-top: 1px solid var(--line); font-size: 17px; line-height: 1.4; }
.ob-who li:last-child { border-bottom: 1px solid var(--line); }
.ob-note { padding: 22px 24px; border-radius: var(--r-md); background: var(--white); }
.ob-note h3 { margin-bottom: 8px; font-family: var(--display); font-size: 18px; font-weight: 500; letter-spacing: -.02em; }
.ob-note p { margin: 0 0 10px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.ob-note p:last-child { margin: 0; }
.ob-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.ob-steps li { position: relative; padding: 16px 0 16px 44px; border-top: 1px solid var(--line); font-size: 16.5px; line-height: 1.45; counter-increment: s; }
.ob-steps li::before { content: counter(s); position: absolute; left: 0; top: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--white); font-size: 14px; font-weight: 600; line-height: 30px; text-align: center; }
.ob-steps b { font-weight: 600; }

@media (max-width: 900px) {
  .ob-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ob-how { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ob-list { grid-template-columns: 1fr; gap: 0; }
  .ob-item { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; padding: 16px 0; border-top: 1px solid var(--line); }
  .ob-item .lposter { aspect-ratio: 1; object-position: 100% 50%; }
  .ob-item__meta { margin-top: 0; font-size: 13px; }
  .ob-item h3 { font-size: 16px; }
  .ob-item__desc { margin-top: 6px; font-size: 14px; }
  .ob-spec { gap: 12px; }
  .ob-spec span { font-size: 13.5px; }
}

/* ——— Обложка урока ——— */
.lposter { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: var(--gray-2); }
.lposter--crop { aspect-ratio: 1; object-position: 100% 50%; } /* на мелкой обложке текст слайда не читается: только кадр */
.lposter--empty { display: grid; place-items: center; color: var(--muted); font-size: 14px; }

/* ——— Оболочка кабинета ——— */
.lms { background: var(--gray); min-height: 100dvh; display: flex; flex-direction: column; overflow-x: clip; }
.lms main { flex: 1; }
.lh { background: var(--black); color: var(--white); }
.lh__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.lh__brand { display: inline-flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; font-family: var(--display); font-size: 16px; font-weight: 500; white-space: nowrap; }
.lh__brand:hover { color: var(--white); }
.lh__nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 24px); }
.lh__nav a, .lh__nav button { min-height: 44px; display: inline-flex; align-items: center; padding: 0; border: 0; background: none; color: var(--on-dark); font: inherit; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.lh__nav a:hover, .lh__nav button:hover { color: var(--white); text-decoration: underline; }
.lh__nav a[aria-current="page"] { color: var(--white); font-weight: 600; }
.lh__nav form { display: contents; }
.lf { padding-block: 20px; background: var(--white); border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.lf__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.lf p { margin: 0; }
.lf ul { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; padding: 0; list-style: none; }
.lf a { color: var(--ink-2); }

/* ——— Короткие страницы: вход, пароль, состояния ——— */
.lms--center main { display: grid; align-items: start; justify-items: center; padding: clamp(24px, 7vh, 72px) 16px; }
.lbox { width: 100%; max-width: 440px; padding: clamp(24px, 4vw, 40px); border-radius: var(--r-xl); background: var(--white); }
.lbox--wide { max-width: 620px; }
.lbox h1 { font-family: var(--display); font-size: clamp(26px, 3vw, 34px); font-weight: 500; }
.lbox__lead { margin: 12px 0 20px; color: var(--ink-2); line-height: 1.5; }
.lbox__foot { margin: 18px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.lbox__contact { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.lform { display: grid; gap: 16px; }
.lactions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.lalert { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--r-sm); background: #fdeeec; color: #a8241a; font-size: 15px; line-height: 1.4; font-weight: 600; }
.lok { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--ok-bg); color: #14613a; font-size: 15px; line-height: 1.4; font-weight: 600; }
.lleft { margin: 0 0 16px; padding: 0; list-style: none; }
.lleft li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.lleft span { color: var(--muted); }
.lempty { margin: 0; padding: 24px; border-radius: var(--r-md); background: var(--white); color: var(--ink-2); }

/* ——— Кабинет ——— */
.lc-top { padding-block: clamp(24px, 4vw, 48px) clamp(28px, 4vw, 56px); background: var(--black); color: var(--white); }
.lc-top__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
.lc-top h1 { font-family: var(--display); font-size: clamp(26px, 3.4vw, 46px); font-weight: 500; overflow-wrap: anywhere; }
.lc-top__course { margin: 10px 0 24px; color: var(--on-dark-2); font-size: 16px; }
.lc-top__term { margin: 14px 0 0; color: var(--on-dark-2); font-size: 14.5px; }
.lc-progress__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin-bottom: 8px; }
.lc-progress__row b { white-space: nowrap; font-family: var(--display); font-size: 28px; font-weight: 500; letter-spacing: -.02em; }
.lc-progress__row span { color: var(--on-dark); font-size: 15px; }

progress { display: block; width: 100%; height: 6px; border: 0; border-radius: var(--pill); overflow: hidden; background: rgba(255, 255, 255, .18); appearance: none; -webkit-appearance: none; }
progress::-webkit-progress-bar { background: rgba(255, 255, 255, .18); border-radius: var(--pill); }
progress::-webkit-progress-value { background: var(--blue); border-radius: var(--pill); }
progress::-moz-progress-bar { background: var(--blue); border-radius: var(--pill); }

.lc-next { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 22px; padding: 14px; border-radius: var(--r-xl); background: #17171a; color: var(--white); text-decoration: none; }
.lc-next:hover { color: var(--white); background: #1e1e22; }
.lc-next__pic { display: block; }
.lc-next__text { display: grid; justify-items: start; gap: 8px; padding-right: 10px; min-width: 0; }
.lc-next__meta { color: var(--on-dark-2); font-size: 14px; line-height: 1.35; }
.lc-next__title { font-family: var(--display); font-size: clamp(18px, 1.7vw, 24px); font-weight: 500; line-height: 1.2; letter-spacing: -.02em; }
.lc-next__btn { margin-top: 8px; }
.lc-next:hover .lc-next__btn { background: var(--blue-hover); }
.lc-finished { padding: clamp(20px, 3vw, 32px); border-radius: var(--r-xl); background: #17171a; }
.lc-finished h2 { font-family: var(--display); font-size: clamp(24px, 2.6vw, 34px); font-weight: 500; }
.lc-finished p { margin: 10px 0 18px; color: var(--on-dark); }

.lc-list-wrap { padding-block: clamp(28px, 4vw, 56px); }
.lc-list-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 32px; margin-bottom: 20px; }
.lc-list-head h2 { margin: 0; }
.lc-hint { margin: 0; font-size: 14.5px; line-height: 1.4; color: var(--muted); max-width: 40em; }
.lc-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.lc-row { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 12px 20px 12px 12px; border-radius: var(--r-md); background: var(--white); }
.lc-row:hover { box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgba(0, 0, 0, .06); }
.lc-row__pic { position: relative; display: block; }
.lc-row__ok { position: absolute; right: 6px; bottom: 6px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: var(--white); }
.lc-row__ok .icon { width: 15px; height: 15px; }
.lc-row__text { display: grid; gap: 4px; min-width: 0; }
.lc-row__meta { margin: 0; font-size: 13.5px; color: var(--muted); }
.lc-row__title { margin: 0; font-family: var(--font); font-size: 16.5px; font-weight: 600; line-height: 1.28; letter-spacing: -.015em; }
.lc-row__title a { color: var(--ink); text-decoration: none; }
.lc-row__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* вся строка ведёт в урок */
.lc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; }
.lc-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: var(--pill); background: var(--gray); color: var(--ink-2); font-size: 13px; font-weight: 500; text-decoration: none; }
.lc-chip--link { position: relative; z-index: 1; }
.lc-chip--link:hover { background: var(--gray-2); color: var(--ink); }
.lc-chip--now { background: #e8f2fc; color: var(--blue-text); }
.lc-chip--ok { background: var(--ok-bg); color: #14613a; }
.lc-chip--bad { background: #fdeeec; color: #a8241a; }
.lc-row__go { position: relative; z-index: 1; min-height: 42px; padding-inline: 20px; font-size: 15px; white-space: nowrap; }
.lc-row--done .lc-row__go { background: none; color: var(--muted); }
.lc-row--done .lc-row__go:hover { color: var(--ink); background: var(--gray); }
.ltag { display: inline-block; padding: 1px 8px; border-radius: var(--pill); background: var(--gray-2); color: var(--ink-2); font-size: 12.5px; font-weight: 600; vertical-align: 1px; }
.ltag--dark { background: rgba(255, 255, 255, .16); color: var(--white); font-family: var(--font); letter-spacing: 0; vertical-align: 5px; }

@media (max-width: 900px) {
  .lc-top__row { grid-template-columns: 1fr; }
  .lc-next { grid-template-columns: 1fr; gap: 14px; padding: 10px 10px 16px; }
  .lc-next__text { padding: 0 6px; }
  .lc-next__btn { width: 100%; }
}
@media (max-width: 640px) {
  .lc-next { padding: 16px 12px; }
  .lc-next__pic { display: none; } /* кнопка важнее: уроки не уезжают за первый экран */
  .lc-row { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 10px; align-items: start; }
  .lc-row__title { font-size: 15.5px; }
  .lc-row__meta { font-size: 13px; }
  .lc-row__go { grid-column: 1 / -1; width: 100%; }
  .lc-row--done .lc-row__go, .lc-row--new .lc-row__go { display: none; }
}

/* ——— Урок ——— */
.ls-stage { padding-block: clamp(14px, 2vw, 24px) clamp(20px, 3vw, 32px); background: var(--black); color: var(--white); --focus: #fff; }
.ls-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px clamp(20px, 3vw, 32px); align-items: stretch; }
.ls-grid:not(:has(.ls-side)) { grid-template-columns: minmax(0, 1fr); }
.ls-main { display: grid; gap: 12px; min-width: 0; align-content: start; }
.ls-head { margin-bottom: 4px; }
.ls-head__meta { margin: 0 0 4px; font-size: 14px; color: var(--on-dark-2); }
.ls-head__meta a { color: var(--on-dark); }
.ls-head__meta a:hover { color: var(--white); }
.ls-head h1 { font-family: var(--display); font-size: clamp(22px, 2.3vw, 30px); font-weight: 500; line-height: 1.2; }
.ls-head__draft { margin: 8px 0 0; color: var(--on-dark); font-size: 15px; }

.ls-player { position: relative; overflow: hidden; border-radius: 12px; background: #000; }
.ls-player video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; }
.ls-player--none { display: grid; place-items: center; aspect-ratio: 16 / 9; padding: 24px; background: #17171a; text-align: center; color: var(--on-dark); }
.ls-player--none p { margin: 0; max-width: 28em; }

/* Конец видео: следующий шаг прямо на плеере */
.ls-end { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; padding: 12px 16px; background: rgba(0, 0, 0, .84); text-align: center; }
.ls-end[hidden] { display: none; }
.ls-end__t { margin: 0; font-family: var(--display); font-size: clamp(18px, 2.4vw, 30px); font-weight: 500; line-height: 1.2; color: var(--white); }
.ls-end__s { margin: 0; max-width: 34em; font-size: clamp(13.5px, 1.3vw, 16px); line-height: 1.35; color: var(--on-dark); }
.ls-end__do { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 16px; margin-top: 8px; }
.ls-end__do [hidden] { display: none; }
.ls-end__do .btn { min-height: 44px; padding-inline: 22px; }
.ls-end__again { min-height: 36px; padding: 0 4px; border: 0; background: none; color: var(--on-dark); font: inherit; font-size: 14.5px; text-decoration: underline; cursor: pointer; }
.ls-end__again:hover { color: var(--white); }

.ls-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ls-tool { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid var(--line-dark); border-radius: var(--pill); background: none; color: var(--on-dark); font: inherit; font-size: 14.5px; cursor: pointer; }
.ls-tool:hover { border-color: rgba(255, 255, 255, .5); color: var(--white); }
.ls-tool[aria-pressed="true"] { border-color: var(--white); background: var(--white); color: var(--ink); font-weight: 600; }
.ls-tool select { min-height: 32px; border: 0; background: transparent; color: var(--white); font: inherit; font-weight: 600; cursor: pointer; }
.ls-tool select option { color: var(--ink); }
.ls-resume { font-size: 14px; color: var(--on-dark-2); }
.ls-resume[hidden], .ls-net[hidden], .ls-videoerr[hidden] { display: none; }
.ls-resume button { padding: 0; border: 0; background: none; color: var(--white); font: inherit; text-decoration: underline; cursor: pointer; }
.ls-net { font-size: 14px; color: var(--on-dark-2); }
.ls-videoerr { margin: 0; padding: 12px 16px; border-radius: var(--r-sm); background: #3a1512; color: #ffd9d4; font-size: 15px; }
.ls-videoerr a { color: var(--white); }

/* Маршрут урока: видео → тест → дальше */
.ls-route { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.ls-route--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ls-step { min-width: 0; border-radius: var(--r-md); background: #17171a; }
.ls-step > a, .ls-step--watch { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; min-height: 72px; padding: 12px 14px; color: var(--white); text-decoration: none; border-radius: var(--r-md); }
.ls-step--watch { grid-template-columns: 28px minmax(0, 1fr); }
.ls-step > a:hover { color: var(--white); background: #222227; }
.ls-step > a > .icon { align-self: center; width: 18px; height: 18px; color: var(--on-dark-2); }
.ls-step__n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, .12); font-size: 14px; font-weight: 600; }
.ls-step__n .icon { display: none; width: 15px; height: 15px; }
.ls-step__text { display: grid; gap: 2px; min-width: 0; }
.ls-step__t { font-size: 15.5px; font-weight: 600; line-height: 1.25; }
.ls-step__s { font-size: 13.5px; line-height: 1.3; color: var(--on-dark-2); }
.ls-step progress { height: 4px; margin-top: 6px; }
/* Сделанный шаг — галочка, текущий — синий */
[data-seen="1"] .ls-step--watch .ls-step__n, [data-passed="1"] .ls-step--test .ls-step__n { background: var(--blue); }
[data-seen="1"] .ls-step--watch .ls-step__num, [data-passed="1"] .ls-step--test .ls-step__num { display: none; }
[data-seen="1"] .ls-step--watch .ls-step__n .icon, [data-passed="1"] .ls-step--test .ls-step__n .icon { display: block; }
[data-seen="1"] .ls-step--watch progress { display: none; }
[data-stage="watch"] .ls-step--watch { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .34); }
[data-stage="test"] .ls-step--test > a, [data-stage="next"] .ls-step--next > a { background: var(--blue); }
[data-stage="test"] .ls-step--test > a:hover, [data-stage="next"] .ls-step--next > a:hover { background: var(--blue-hover); }
[data-stage="test"] .ls-step--test .ls-step__n, [data-stage="next"] .ls-step--next .ls-step__n { background: rgba(255, 255, 255, .22); }
[data-stage="test"] .ls-step--test .ls-step__s, [data-stage="next"] .ls-step--next .ls-step__s, [data-stage="test"] .ls-step--test > a > .icon, [data-stage="next"] .ls-step--next > a > .icon { color: rgba(255, 255, 255, .86); }

/* Главы справа от плеера */
.ls-side { min-width: 0; }
.ls-chapters-box { height: 100%; padding: 14px 8px 8px; border-radius: var(--r-md); background: #17171a; }
.ls-chapters-box summary { display: flex; align-items: center; gap: 8px; padding: 0 8px 8px; font-family: var(--display); font-size: 16px; font-weight: 500; color: var(--white); cursor: pointer; list-style: none; }
.ls-chapters-box summary::-webkit-details-marker { display: none; }
.ls-chapters-box summary span { color: var(--on-dark-2); font-size: 14px; }
.ls-chapters-box summary .icon { width: 16px; height: 16px; margin-left: auto; transform: rotate(90deg); color: var(--on-dark-2); }
.ls-chapters-box[open] summary .icon { transform: rotate(-90deg); }
.ls-chapters { margin: 0; padding: 0; list-style: none; }
.ls-chapters button { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; width: 100%; min-height: 40px; padding: 8px; border: 0; border-radius: 10px; background: none; color: var(--on-dark); font: inherit; font-size: 14.5px; line-height: 1.3; text-align: left; cursor: pointer; }
.ls-chapters button span:first-child { color: var(--on-dark-2); font-variant-numeric: tabular-nums; }
.ls-chapters button:hover:not([disabled]) { background: #222227; color: var(--white); }
.ls-chapters button[aria-current] { background: #2a2a30; color: var(--white); font-weight: 600; }
.ls-chapters button[disabled] { cursor: default; opacity: .6; }

/* Светлая часть: о чём урок и весь курс */
.ls-body { padding-block: clamp(28px, 4vw, 48px); }
.ls-body__grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(20px, 3vw, 32px); align-items: start; }
.ls-about { display: grid; gap: 24px; min-width: 0; }
.ls-desc { margin: 0; max-width: 40em; font-size: clamp(17px, 1.5vw, 19px); line-height: 1.45; color: var(--ink-2); }
.ls-outcomes { padding: clamp(18px, 2.6vw, 28px); border-radius: var(--r-md); background: var(--white); }
.ls-outcomes h2 { margin-bottom: 14px; font-size: clamp(20px, 2vw, 26px); }
.ls-outcomes ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.ls-outcomes li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; line-height: 1.4; }
.ls-outcomes .icon { width: 18px; height: 18px; margin-top: 2px; color: var(--blue); }
.ls-card { padding: 16px 8px 8px; border-radius: var(--r-md); background: var(--white); }
.ls-card h2 { margin: 0 0 8px; padding-inline: 10px; font-family: var(--display); font-size: 17px; font-weight: 500; }
.ls-lessons { margin: 0; padding: 0; list-style: none; }
.ls-lessons a { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; min-height: 44px; align-items: start; padding: 7px 10px; border-radius: 10px; color: var(--ink); font-size: 14.5px; line-height: 1.3; text-decoration: none; }
.ls-lessons a:hover { background: var(--gray); color: var(--ink); }
.ls-lessons a[aria-current="page"] { background: var(--gray-2); font-weight: 600; }
.ls-lessons__text { display: grid; gap: 1px; min-width: 0; }
.ls-lessons small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.ls-lessons__mark { display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border: 1.5px solid #b9b9c2; border-radius: 50%; }
.ls-lessons .is-done .ls-lessons__mark { border-color: var(--blue); background: var(--blue); color: var(--white); }
.ls-lessons__mark .icon { width: 12px; height: 12px; }

/* ——— Страница теста ——— */
.lq { width: 100%; max-width: 760px; margin-inline: auto; padding: clamp(20px, 4vw, 48px) 16px clamp(32px, 5vw, 64px); }
.lq__back { margin: 0 0 18px; font-size: 15px; }
.lq__meta { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.lq h1 { font-family: var(--display); font-size: clamp(24px, 3vw, 36px); font-weight: 500; line-height: 1.2; }
.lq__lead { margin: 10px 0 0; color: var(--ink-2); }
.lq-res { margin-top: 20px; padding: 18px 20px; border-radius: var(--r-md); }
.lq-res h2 { font-family: var(--display); font-size: 21px; font-weight: 500; }
.lq-res p { margin: 6px 0 0; line-height: 1.45; }
.lq-res .lactions { margin-top: 14px; }
.lq-res--ok { background: var(--ok-bg); color: #14613a; }
.lq-res--bad { background: #fdeeec; color: #8c1d14; }
.lq-res--bad a { color: inherit; font-weight: 600; }
.lq__form { display: grid; gap: 12px; margin-top: 20px; justify-items: start; }
.ls-q { width: 100%; min-width: 0; margin: 0; padding: clamp(16px, 2.6vw, 24px); border: 0; border-radius: var(--r-md); background: var(--white); }
.ls-q legend { float: left; width: 100%; padding: 0; margin-bottom: 12px; font-weight: 600; font-size: 16.5px; line-height: 1.35; }
.ls-q legend + * { clear: both; }
.ls-opt { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: start; min-height: 46px; padding: 11px 14px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: var(--r-sm); line-height: 1.4; cursor: pointer; }
.ls-opt:last-child { margin-bottom: 0; }
.ls-opt:hover { border-color: #b9b9c2; }
.ls-opt input { width: 20px; height: 20px; margin: 0; accent-color: var(--blue); }
.ls-opt:has(input:checked) { border-color: var(--blue); background: #f0f6fd; }
.ls-opt small { font-size: 13px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.ls-opt.is-right, .ls-opt.is-right:has(input:checked) { border-color: var(--ok); background: var(--ok-bg); }
.ls-opt.is-right small { color: #14613a; }
.ls-opt.is-right input { accent-color: var(--ok); }
.ls-opt.is-wrong { border-color: #e2a29b; background: #fdf3f2; }
.ls-opt.is-wrong small { color: #a8241a; }
fieldset[disabled] .ls-opt { cursor: default; }

@media (max-width: 980px) {
  .ls-grid, .ls-body__grid { grid-template-columns: 1fr; }
  /* На телефоне сначала плеер, сразу под ним название и маршрут, главы ниже */
  .ls-grid { gap: 12px; }
  .ls-main { display: contents; }
  .ls-side { order: 6; }
  .ls-player { order: 1; }
  .ls-tools { order: 2; }
  .ls-videoerr { order: 3; }
  .ls-head { order: 4; margin: 4px 0 0; }
  .ls-route { order: 5; }
  .ls-chapters-box { height: auto; padding-bottom: 6px; }
  .ls-chapters-box:not([open]) summary { padding-bottom: 6px; }
}
@media (max-width: 720px) {
  .ls-stage { padding-top: 0; }
  .ls-stage .wrap { padding-inline: 0; }
  .ls-player { border-radius: 0; }
  .ls-tools, .ls-head, .ls-route, .ls-side, .ls-videoerr { margin-inline: 16px; }
  .ls-route, .ls-route--two { grid-template-columns: 1fr; }
  .ls-step > a, .ls-step--watch { min-height: 60px; align-items: center; }
  .ls-end { padding: 8px 12px; gap: 3px; }
  .ls-end__do { margin-top: 4px; }
  .ls-end__do .btn { min-height: 40px; padding-inline: 18px; font-size: 15px; }
  .ls-end__again { min-height: 30px; font-size: 13.5px; }
  .ls-opt { grid-template-columns: 20px minmax(0, 1fr); }
  .ls-opt small { grid-column: 2; margin-top: -6px; }
  .lq-res .btn { width: 100%; }
  .lq__form .btn { width: 100%; }
}
/* Телефон лёжа: плеер на весь экран, с учётом выреза. Шапка и остальное — ниже прокруткой. */
@media (orientation: landscape) and (max-height: 500px) {
  .lms--lesson .lh { display: none; }
  .ls-stage { padding: 0 0 16px; }
  .ls-stage .wrap { padding-inline: 0; max-width: none; }
  .ls-grid { grid-template-columns: 1fr; gap: 12px; }
  .ls-main { display: contents; }
  .ls-side { order: 6; }
  .ls-player { order: 1; border-radius: 0; background: #000; padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); }
  .ls-tools { order: 2; }
  .ls-videoerr { order: 3; }
  .ls-head { order: 4; }
  .ls-route { order: 5; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ls-route--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ls-player video { width: auto; max-width: 100%; height: 100dvh; margin-inline: auto; }
  .ls-tools, .ls-head, .ls-route, .ls-side, .ls-videoerr { margin-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
}

/* ——— Подтверждение прохождения ——— */
.lcert-wrap { padding: clamp(20px, 4vw, 48px) 16px; }
.lcert-tools { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 20px; }
.lcert { max-width: 760px; margin-inline: auto; padding: clamp(28px, 6vw, 64px); border-radius: var(--r-md); background: var(--white); text-align: center; }
.lcert__head { display: inline-flex; align-items: center; gap: 12px; font-family: var(--display); font-size: 18px; font-weight: 500; }
.lcert h1 { margin-top: clamp(24px, 4vw, 44px); font-family: var(--display); font-size: clamp(26px, 3.6vw, 40px); font-weight: 500; }
.lcert__name { margin: clamp(20px, 3vw, 32px) 0 8px; font-family: var(--display); font-size: clamp(22px, 3vw, 32px); font-weight: 500; letter-spacing: -.02em; overflow-wrap: anywhere; }
.lcert__text { margin: 0 auto; max-width: 30em; font-size: 17px; line-height: 1.45; color: var(--ink-2); }
.lcert__facts { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 48px; margin: 28px 0; }
.lcert__facts dt { font-size: 13.5px; color: var(--muted); }
.lcert__facts dd { margin: 2px 0 0; font-size: 17px; font-weight: 600; }
.lcert__warn { margin: 0; padding: 16px 18px; border-radius: var(--r-sm); background: var(--gray); font-size: 14.5px; line-height: 1.45; color: var(--ink-2); text-align: left; }
.lcert__foot { margin-top: 20px; font-size: 13.5px; color: var(--muted); }

@media print {
  .lh, .lf, .lcert-tools, .skip { display: none !important; }
  .lms, .lms main, .lcert-wrap { display: block; min-height: 0; padding: 0; background: #fff; }
  .lcert { max-width: none; padding: 16mm 8mm; border-radius: 0; }
  .lcert__warn { border: 1px solid #999; background: #fff; }
  @page { size: A4; margin: 12mm; }
}

@media (prefers-reduced-motion: reduce) {
  .lc-next { transition: none; }
}

/* На узком экране в шапке только знак: подпись наезжала бы на меню. */
@media (max-width: 480px) { .lh__brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } }
