/* Optional landing story. No pin-release fallback: each sticky stage fits by construction. */
#landing-view { --landing-more-ready: 1; }
/* landing-more.js sets .lm-on on #landing-view (and .lm-landing on <html> while the landing shows) instead of :has():
   the explainer mutates its timer text every scroll frame, and a :has() on the landing re-styled the whole page each time. */
#landing-view.lm-on { position: relative; isolation: isolate; }
/* Paper: the landing becomes a sheet of a student's squared notebook (24px cells), with a fine static grain and a soft
   vignette. One fixed layer (theme.css's .wl::before) painted once; nothing on it moves. Grid lines are opaque token
   mixes, so crossings never darken twice and the grain stays under them. The grid lines up with the
   content edge (--lm-grid-x, set by landing-more.js on resize) and with the sticky pin line, so pinned windows sit
   on the grid while they are held. */
#landing-view {
  --lm-paper: var(--bg); --lm-grid: color-mix(in srgb, var(--line) 50%, var(--lm-paper)); --lm-grid-x: 0px; --lm-grid-y: 72px;
  --lm-vignette: radial-gradient(130% 95% at 50% 22%, rgba(243, 243, 239, .025), transparent 58%, rgba(0, 0, 0, .4));
  --lm-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 .03 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  /* The student's highlighter: a lime marker on dark paper (dark ink on top), warm yellow on light paper. */
  --lm-marker: #dcef62; --lm-marker-ink: #0b0c0c; --lm-spark: #dcef62;
}
:root[data-theme="light"] #landing-view {
  /* Lighter than the app's wall colour, so --subtle text keeps 4.5:1 even on a grid line; no darkened edges. */
  --lm-paper: #f2eee4; --lm-grid: color-mix(in srgb, var(--line-2) 30%, var(--lm-paper));
  --lm-vignette: radial-gradient(130% 95% at 50% 22%, rgba(255, 254, 250, .55), transparent 65%);
  --lm-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .24 0 0 0 0 .16 0 0 0 0 .08 .025 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --lm-marker: #f3d35c; --lm-marker-ink: var(--text); --lm-spark: var(--signal);
}
@media (max-width: 850px) { #landing-view { --lm-grid-y: 56px; } }
#landing-view.lm-on:not(.lm-paper)::before { opacity: 0; }
#landing-view.lm-on::before {
  opacity: 1; background-color: var(--lm-paper); transition: opacity 400ms var(--ease-out, ease-out);
  background-image: var(--lm-vignette), linear-gradient(var(--lm-grid) 1px, transparent 1px), linear-gradient(90deg, var(--lm-grid) 1px, transparent 1px), var(--lm-grain);
  background-size: 100% 100%, 24px 24px, 24px 24px, 160px 160px;
  background-position: 0 0, 0 var(--lm-grid-y), var(--lm-grid-x) 0, 0 0;
}
/* Margin: the red margin line of a school notebook, fixed in the left gutter under the top bar (landing-more.js). It
   appears once the explainer is pinned, draws down to the current section's number square and stays until the footer.
   Inside a block it is still; each new point moves the square one notch lower with a short ease-out, and between
   blocks it waits for the next block's first point. Decorative, aria-hidden, never under text. */
.lm-margin { position: fixed; top: 56px; left: 0; z-index: 0; width: 0; height: 0; pointer-events: none; opacity: 0; transition: opacity 300ms var(--ease-out, ease-out); }
.lm-margin.is-on { opacity: 1; }
.lm-margin[hidden] { display: none; }
.lm-rule { position: absolute; top: 0; left: 0; width: 1px; background: var(--signal); transform-origin: 50% 0; transform: scaleY(0); transition: transform 480ms cubic-bezier(.22, 1, .36, 1); }
/* The line ends in the current section's number square (the app's chapter-number style); its digits cross-fade. */
.lm-bead { position: absolute; top: 0; left: 0; width: 24px; height: 24px; margin: -12px 0 0 -11.5px; display: grid; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel-2); color: var(--text); font: 600 12px/22px var(--mono); text-align: center; transition: transform 480ms cubic-bezier(.22, 1, .36, 1); }
.lm-bead > span { grid-area: 1 / 1; opacity: 0; transition: opacity 200ms var(--ease-out, ease-out); }
.lm-bead[data-n="1"] > :nth-child(1), .lm-bead[data-n="2"] > :nth-child(2), .lm-bead[data-n="3"] > :nth-child(3), .lm-bead[data-n="4"] > :nth-child(4) { opacity: 1; }
/* Below 1248px there is no gutter: each section heading carries a short signal rule in its own box, so it moves with
   the heading natively (B's heading is sticky) and never lags. Where scroll-driven animations exist it draws down as
   the heading enters; elsewhere, and under reduced motion, it is simply there. */
@media (max-width: 1247px) {
 #landing-view.lm-on :is(.ls-title, #lm-a-title, #lm-b-title, #lm-c-title) { position: relative; view-timeline-name: --lm-heading; }
 #landing-view.lm-on :is(.ls-title, #lm-a-title, #lm-b-title, #lm-c-title)::before { content: ""; position: absolute; top: .16em; left: calc(clamp(16px, 4vw, 48px) / -2 - 1px); width: 2px; height: .82em; border-radius: 1px; background: var(--signal); transform-origin: 50% 0; }
}
@supports (animation-timeline: view()) {
 @media (max-width: 1247px) and (prefers-reduced-motion: no-preference) {
  #landing-view.lm-on :is(.ls-title, #lm-a-title, #lm-b-title, #lm-c-title)::before { animation: lm-rule-draw linear both; animation-timeline: --lm-heading; animation-range: entry 10% entry 90%; }
 }
}
@keyframes lm-rule-draw { from { transform: scaleY(0); } to { transform: scaleY(1); } }
/* Highlighter: a copy of the phrase in marker ink on a marker stroke, revealed left to right over the original text. */
.lm-mark { position: relative; display: inline-block; margin-inline: .06em; white-space: nowrap; }
/* The clip starts .1em below the line box, so the stroke never covers descenders of the line above. */
.lm-mark-ink { position: absolute; inset: -.02em -.12em -.06em; z-index: 1; padding: .02em .12em .06em; background: var(--lm-marker); color: var(--lm-marker-ink); white-space: nowrap; pointer-events: none; user-select: none; clip-path: inset(.1em 100% 0 0 round .2em); }
/* Stickers: a box beside the "После лекции" heading holding a sparkle, and a ring of text by the closing invitation. */
.lm-heading-box { display: inline-grid; place-items: center; width: .8em; height: .8em; margin-inline-start: .32em; vertical-align: -.04em; border: 1px solid var(--line-2); border-radius: .12em; }
.lm-heading-box svg { width: .46em; height: .46em; fill: var(--lm-spark); }
#landing-view .wl-cta.lm-enabled { position: relative; }
.lm-ring { position: absolute; top: 50%; right: 7%; width: 128px; height: 128px; margin-top: -64px; color: var(--muted); pointer-events: none; }
.lm-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lm-ring-text { font: 600 11px/1 var(--display); letter-spacing: .02em; fill: currentColor; }
.lm-ring circle { fill: none; stroke: var(--line-2); stroke-width: 1px; }
.lm-ring-check { stroke: var(--text); stroke-width: 2.5px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 999px) { .lm-ring { display: none; } }
/* The pinned app window gets a hairline outer frame. */
.lm-window { outline: 1px solid var(--line); outline-offset: 10px; }
@media (max-width: 600px) { .lm-window { outline-offset: 7px; } }
@media (prefers-reduced-motion: reduce) { #landing-view.lm-on::before { transition: none; }.lm-rule,.lm-bead,.lm-bead > span,.lm-margin { transition: none; }.lm-mark-ink { clip-path: inset(.1em 0 0 0 round .2em); } }
@media print { #landing-view.lm-on::before { background-image: none; }#landing-view.lm-on :is(.ls-title, #lm-a-title, #lm-b-title, #lm-c-title)::before { display: none; }.lm-margin,.lm-ring,.lm-heading-box,.lm-mark-ink { display: none !important; }.lm-window { outline: 0; } }
#landing-view .lm-enabled > [data-landing-legacy] { display: none; }
/* Targets reach 44px with the layer: the top bar's 28-40px links get an invisible taller hit area (nothing moves), and
   the theme/language buttons get the 44px width they already have on touch screens. */
#landing-view.lm-on .wl-bar :is(.brand, .wl-nav a, .wl-login) { position: relative; }
#landing-view.lm-on .wl-bar :is(.brand, .wl-nav a, .wl-login)::after { content: ""; position: absolute; inset: min(0px, (100% - 44px) / 2) 0; }
#landing-view.lm-on .wl-bar-end .pref-switch button { min-width: 44px; }
#landing-view.lm-on .ls { --ls-story-leg: 127.5vh; }
/* Even pacing for the explainer inside the story (fractions of one step: 127.5vh, 120vh on phones). Each transition takes
   17-35vh, each finished state holds 30vh or more, and nothing arrives under something that is still leaving. The wave
   band is squeezed with a transform here instead of its height, over 34vh because it is the biggest change. */
#landing-view.lm-on .ls-wave { height: 100%; transform-origin: 50% 0; transform: scaleY(calc(1 - min(1, var(--s1) / .27) * .82)); opacity: calc(1 - min(1, var(--s2) / .16)); }
#landing-view.lm-on .ls-lines li { --k: clamp(0, (var(--s1) - .3) / .14 - var(--i) * .43, 1); }
#landing-view.lm-on .ls-lines { opacity: calc(1 - min(1, var(--s2) / .16)); transform: translateY(calc(min(1, var(--s2) / .16) * -12px)); }
#landing-view.lm-on .ls-summary > * { --k: clamp(0, (var(--s2) - .18) / .14 - var(--i) * .55, 1); }
#landing-view.lm-on .ls-summary { opacity: calc(1 - min(1, var(--s3) / .2) * .55); transform: translateY(calc(min(1, var(--s3) / .2) * -12px)); }
#landing-view.lm-on .ls-practice > * { --k: clamp(0, (var(--s3) - .1) / .16 - var(--i) * .875, 1); }
/* Phones: the short panel has no room for both, so the summary leaves before the questions arrive. */
@media (max-width: 850px) {
 #landing-view.lm-on .ls-summary { opacity: calc(1 - min(1, var(--s3) / .14)); }
 #landing-view.lm-on .ls-practice > * { --k: clamp(0, (var(--s3) - .16) / .16 - var(--i) * .875, 1); }
}
@media (max-width: 850px) { #landing-view.lm-on .ls { --ls-story-leg: 120vh; } }
/* The explainer's amber verdict uses the amber text token with the layer (3.4:1 -> 6.9:1 on the light panel). */
#landing-view.lm-on .ls-verdict { color: var(--warn-ink); }
/* Reduced motion: the waveform does not squeeze; it fades out before the transcript fades in. */
@media (prefers-reduced-motion: reduce) { #landing-view.lm-on .ls-wave { transform: none; opacity: calc(1 - min(1, var(--s1) / .27)); } }
.lm { --lm-pin: 72px; --lm-height: min(740px, calc(100svh - var(--lm-pin) - 16px)); --p: 0; --s0: 0; --s1: 0; --s2: 0; --s3: 0; color: var(--text); font-family: var(--display); }
.lm [hidden] { display: none !important; }
.lm-heading { margin: 0 0 24px; font: 750 clamp(30px, 4vw, 48px)/1.1 var(--display); letter-spacing: -.03em; text-wrap: balance; }
#landing-view #features.lm-enabled { padding-block: 32px 24px; }
/* Scene runways in vh (reader, Практика, Проверка, Экспорт); landing-more.js splits the travel in these proportions.
   Every transition inside A takes 15-30vh and every readable state holds 25vh or more: the typed answer and the
   handwritten one are read before their verdicts arrive. */
.lm-a { --lm-a-s1: 455; --lm-a-s2: 140; --lm-a-s3: 200; --lm-a-s4: 110; height: calc((var(--lm-a-s1) + var(--lm-a-s2) + var(--lm-a-s3) + var(--lm-a-s4)) * 1vh + var(--lm-height) + 80px); }
.lm-a-pin { position: sticky; top: var(--lm-pin); height: var(--lm-height); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 64px 3px 44px minmax(0, 1fr); gap: 12px; padding-bottom: 4px; }
.lm-captions { display: grid; margin: 0; padding: 0; list-style: none; align-items: center; }
.lm-caption { grid-area: 1 / 1; --show: 1; --out: 0; opacity: calc(var(--show) * (1 - var(--out))); transform: translateY(calc((1 - var(--show)) * 18px - var(--out) * 18px)); }
.lm-caption h3 { margin: 0; font: 700 clamp(22px, 2.8vw, 34px)/1.2 var(--display); letter-spacing: -.02em; text-wrap: balance; }
/* Hand-offs happen over the first .3 of each --sN. The outgoing caption rises and is gone by .15; the next one
   rises in from .15, so two captions are never readable at once. */
.lm-caption-0 { --out: clamp(0, var(--s1) / .15, 1); }
.lm-caption-1 { --show: clamp(0, (var(--s1) - .15) / .15, 1); --out: clamp(0, var(--s2) / .12, 1); }
.lm-caption-2 { --show: clamp(0, (var(--s2) - .12) / .12, 1); --out: clamp(0, var(--s3) / .15, 1); }
.lm-caption-3 { --show: clamp(0, (var(--s3) - .15) / .15, 1); }
.lm-rail { display: flex; gap: 6px; }
.lm-rail span { position: relative; flex: 1; background: var(--line-2); overflow: hidden; }
.lm-rail span::after { content: ""; position: absolute; inset: 0; background: var(--text); transform-origin: 0 50%; transform: scaleX(var(--fill)); }
.lm-rail span:nth-child(1) { --fill: var(--s0); }.lm-rail span:nth-child(2) { --fill: var(--s1); }.lm-rail span:nth-child(3) { --fill: var(--s2); }.lm-rail span:nth-child(4) { --fill: var(--s3); }
.lm-navigation { display: flex; gap: 6px; }
.lm-navigation button { min-width: 44px; min-height: 44px; padding: 8px 18px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--muted); font: 600 14px/1.3 var(--display); cursor: pointer; transition: none; }
.lm-navigation button[aria-current="true"] { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.lm button:focus-visible, .lm a:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
html.lm-landing { scroll-padding-top: 88px; }
#landing-view.lm-on .wl-footer .policy-link { display: inline-flex; align-items: center; min-height: 44px; }
.lm-app-bar > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-export-trigger { flex: none; }
.lm-window { min-height: 0; min-width: 0; position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 50px 42px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--panel); opacity: .3; transform: translateY(80px); } /* entrance written by landing-more.js */
.lm-app-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 8px 24px; color: var(--muted); font-size: 14px; border-bottom: 1px solid var(--line); }
.lm-export-trigger { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--panel-2); color: var(--text); }
.lm-export-trigger .ui-icon { width: 16px; height: 16px; }
.lm-app-tabs { display: flex; gap: 4px; align-items: center; padding-inline: 18px; color: var(--muted); font-size: 14px; }
.lm-app-tabs span { padding: 6px 14px; border-radius: 999px; }
.lm-window[data-current="0"] .lm-app-tabs span:nth-child(1),.lm-window[data-current="1"] .lm-app-tabs span:nth-child(2),.lm-window[data-current="2"] .lm-app-tabs span:nth-child(3),.lm-window[data-current="3"] .lm-app-tabs span:nth-child(4) { background: var(--panel-3); color: var(--text); }
/* Scenes are clipped to the content area, so a scene leaving upwards never slides over the app tabs. */
.lm-viewport { min-height: 0; position: relative; overflow: clip; }
.lm-scene { position: absolute; inset: 18px 24px 24px; min-width: 0; --show: 1; --out: 0; opacity: calc(var(--show) * (1 - var(--out))); transform-origin: 50% 0; }
.lm-meta { color: var(--muted); font: 500 14px/1.4 var(--display); }
/* Scene 1 replays the summary reader: contents on the left, the document scrolling in its own frame on the right.
   landing-more.js writes transform, opacity and clip-path on these nodes; layout never changes per frame. */
/* Scenes: the outgoing one rises, compresses and is gone by .15 of the hand-off; the next one starts at .126
   (outgoing opacity < .16 by then), so the layers share at most 8 % of the hand-off and never both read. */
.lm-reader { --out: clamp(0, var(--s1) / .15, 1); display: grid; grid-template-columns: minmax(180px, 30%) minmax(0, 1fr); gap: 32px; transform: translateY(calc(var(--out) * -70px)) scaleY(calc(1 - var(--out) * .06)); }
.lm-toc { min-width: 0; display: grid; grid-template-rows: auto auto auto; align-content: start; gap: 12px; }
.lm-toc-label { padding-inline: 12px; color: var(--muted); font: 500 14px/1.4 var(--display); }
.lm-toc-track { position: relative; min-width: 0; }
.lm-toc-press { position: absolute; top: 0; left: 0; background: var(--hover-strong); opacity: 0; }
.lm-toc-strip { position: relative; }
.lm-toc-list { position: relative; z-index: 1; display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.lm-toc-list li { padding: 8px 12px; color: var(--text); font: 500 15px/1.35 var(--display); text-wrap: pretty; transform-origin: 0 50%; opacity: 0; }
/* The app's own active-item treatment (knowledge-base-item.is-active), sized once and clipped to the current row. */
.lm-toc-mark { position: absolute; top: 0; left: 0; border-radius: var(--radius-sm); background: var(--panel-3); box-shadow: inset 2px 0 var(--signal); transform-origin: 0 50%; opacity: 0; }
.lm-doc-frame { position: relative; min-width: 0; min-height: 0; overflow: clip; --lm-doc-inset: 10px; }
/* Edge fades are panel-coloured overlays rather than a mask: a mask over a moving document is a render pass per frame. */
.lm-doc-frame::before, .lm-doc-frame::after { content: ""; position: absolute; inset-inline: 0; z-index: 3; pointer-events: none; }
.lm-doc-frame::before { top: 0; height: var(--lm-doc-inset); background: linear-gradient(var(--panel), color-mix(in srgb, var(--panel) 0%, transparent)); }
.lm-doc-frame::after { bottom: 0; height: 32px; background: linear-gradient(color-mix(in srgb, var(--panel) 0%, transparent), var(--panel)); }
/* Headings stick --lm-doc-inset below the frame edge; a heading pushed out fades in that gutter instead of being cut. */
.lm-doc { position: relative; max-width: 62ch; padding-top: var(--lm-doc-inset); padding-bottom: 40px; }
.lm-doc-intro h3 { margin: 0 0 10px; font: 650 26px/1.2 var(--display); letter-spacing: -.02em; text-wrap: balance; }
.lm-reader .summary-overview { margin: 0; color: var(--reader-ink); font-size: 16px; line-height: 1.6; text-wrap: pretty; }
.lm-chapter { padding-top: 22px; }
.lm-reader .lm-chapter-head { position: relative; z-index: 2; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 12px; margin: 0; padding: 6px 0 10px; background: var(--panel); }
.lm-chapter-head::after { content: ""; position: absolute; inset: auto 0 0; height: 1px; background: var(--line); opacity: var(--stuck, 0); }
.lm-reader .chapter-number { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel-2); color: var(--text); font: 600 12px var(--mono); }
.lm-reader .lm-chapter-head h4 { margin: 0; font: 650 20px/1.25 var(--display); letter-spacing: -.02em; }
.lm-chapter-body { display: grid; gap: 10px; }
.lm-reader .chapter-prose { margin: 0; color: var(--reader-ink); font-size: 16px; line-height: 1.6; text-wrap: pretty; }
.lm .lm-reader .callout-formula { margin: 0; padding: 10px 14px; border: 1px solid var(--good-line); border-left: 3px solid var(--good); border-radius: 6px; background: color-mix(in srgb, var(--good) 8%, var(--panel)); font-size: 17px; line-height: 1.45; }
/* Section 6 uses the app's own self-check list. */
.lm-reader .lm-review { display: grid; gap: 6px; margin: 0; padding-left: 22px; color: var(--reader-ink); }
.lm-reader .lm-review .self-check { margin: 0; }
.lm-reader .lm-review .self-check-question { margin: 0; font-size: 16px; line-height: 1.5; text-wrap: pretty; }
/* The student's pointer: a cursor arrow in the app's ink colour; a touch dot on touch screens. */
.lm-pointer { position: absolute; top: 0; left: 0; z-index: 3; width: 20px; height: 26px; pointer-events: none; transform-origin: 0 0; opacity: 0; }
.lm-pointer-arrow { display: block; width: 20px; height: 26px; fill: var(--text); stroke: var(--panel); stroke-width: 1.5px; stroke-linejoin: round; }
.lm-pointer-dot { display: none; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--text) 16%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text) 72%, transparent); }
.lm-toc-status { margin: 0; padding-inline: 12px; color: var(--muted); font: 500 13px/1.4 var(--display); opacity: 0; }
/* Short tablet-sized windows: the contents column is too narrow for the status on one line and too short for two. */
@media (min-width: 601px) and (max-width: 1199px) and (max-height: 700px) { .lm-toc-status { display: none; } }
@media (hover: none) and (pointer: coarse), (max-width: 600px) {
 .lm-pointer { width: 28px; height: 28px; margin: -14px 0 0 -14px; transform-origin: 50% 50%; }
 .lm-pointer-arrow { display: none; }.lm-pointer-dot { display: block; }
}
@media (min-width: 601px) and (max-height: 760px) {
 .lm-toc-list li { padding-block: 6px; font-size: 14px; }
 .lm-doc-intro h3 { font-size: 22px; }.lm-reader .summary-overview,.lm-reader .chapter-prose { font-size: 15px; line-height: 1.55; }
 .lm-reader .lm-chapter-head h4 { font-size: 18px; }.lm .lm-reader .callout-formula { font-size: 16px; padding-block: 8px; }.lm-reader .lm-review .self-check-question { font-size: 15px; }
}
/* Phones: the contents become one row of chips above the document and slide to keep the current one in view. */
@media (max-width: 600px) {
 .lm-reader { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
 .lm-toc { grid-template-rows: auto; }.lm-toc-label { display: none; }
 .lm-toc-track { overflow: clip; }
 .lm-toc-track::before, .lm-toc-track::after { content: ""; position: absolute; top: 0; bottom: 0; z-index: 2; width: 16px; pointer-events: none; }
 .lm-toc-track::before { left: 0; background: linear-gradient(to right, var(--panel), color-mix(in srgb, var(--panel) 0%, transparent)); }
 .lm-toc-track::after { right: 0; background: linear-gradient(to left, var(--panel), color-mix(in srgb, var(--panel) 0%, transparent)); }
 .lm-toc-strip { width: max-content; }
 .lm-toc-list { display: flex; gap: 6px; }
 .lm-toc-list li { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; white-space: nowrap; }
 .lm-toc-mark { border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); }
 .lm-doc-intro h3 { font-size: 19px; margin-bottom: 8px; }
 .lm-reader .summary-overview,.lm-reader .chapter-prose { font-size: 14px; line-height: 1.5; }
 .lm-chapter { padding-top: 16px; }.lm-chapter-body { gap: 8px; }
 .lm-reader .lm-chapter-head { grid-template-columns: 24px minmax(0, 1fr); gap: 8px; padding: 4px 0 8px; }
 .lm-reader .chapter-number { width: 24px; height: 24px; font-size: 11px; }
 .lm-reader .lm-chapter-head h4 { font-size: 16px; }
 .lm .lm-reader .callout-formula { padding: 8px 10px; font-size: 14px; }
 .lm-reader .lm-review .self-check-question { font-size: 14px; line-height: 1.45; }.lm-reader .lm-review { gap: 4px; padding-left: 18px; }
 .lm-toc-status { display: none; }
}
@media (max-width: 600px) and (max-height: 700px) { .lm-reader .summary-overview,.lm-reader .chapter-prose,.lm-reader .lm-review .self-check-question { font-size: 13px; line-height: 1.45; } .lm-reader .lm-chapter-head h4 { font-size: 15px; } }
.lm .callout-formula { margin: 0; padding: 14px 18px; border: 0; border-radius: var(--radius-md); background: var(--panel-2); color: var(--text); font-size: 20px; line-height: 1.45; overflow-wrap: anywhere; }
.lm-practice { --show: clamp(0, (var(--s1) - .126) / .174, 1); --out: clamp(0, var(--s2) / .12, 1); display: grid; align-content: center; gap: 16px; max-width: 680px; margin-inline: auto; transform: translateY(calc(var(--out) * -70px)) scale(calc(1 - var(--out) * .12)); }
.lm-question { --k: clamp(0, (var(--s1) - .126) / .15, 1); display: grid; gap: 10px; padding: 20px; border-radius: var(--radius-lg); background: var(--panel-2); opacity: var(--k); transform: translateY(calc((1 - var(--k)) * -80px)); }
.lm-question strong { font-size: 23px; line-height: 1.3; letter-spacing: -.015em; }
.lm-practice-answer { display: grid; gap: 8px; padding: 16px 20px; border: 1px solid var(--field-line); border-radius: var(--radius-md); background: var(--panel-2); }
.lm-practice-answer p { --typed: clamp(0, (var(--s1) - .29) / .18, 1); margin: 0; font-size: 17px; line-height: 1.5; clip-path: inset(0 calc((1 - var(--typed)) * 100%) 0 0); }
.lm-practice-verdict { --k: clamp(0, (var(--s1) - .65) / .12, 1); display: grid; gap: 8px; padding: 16px 20px; border-inline-start: 3px solid var(--warn); border-radius: var(--radius-md); background: var(--panel-2); opacity: var(--k); transform: translateY(calc((1 - var(--k)) * -64px)); }
.lm-practice-verdict strong { font-size: 17px; line-height: 1.4; color: var(--warn-ink); } /* the amber text token: 4.5:1 on panels in both themes */.lm-practice-verdict p { margin: 0; font-size: 16px; line-height: 1.45; }
.lm-check { --show: clamp(0, (var(--s2) - .1) / .14, 1); --out: clamp(0, var(--s3) / .15, 1); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 18px; max-width: 720px; margin-inline: auto; transform: translateY(calc(var(--out) * -80px)); }
.lm-mode-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--panel-2); }
.lm-mode-tabs span { --k: clamp(0, (var(--s2) - .1) / .08 - var(--i) * .25, 1); position: relative; isolation: isolate; flex: 1; padding: 10px; text-align: center; border-radius: 999px; font-size: 14px; opacity: var(--k); transform: translateY(calc((1 - var(--k)) * -64px)); }
.lm-mode-tabs span::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--panel-3); opacity: 0; }
.lm-mode-tabs span:nth-child(2)::before { opacity: calc(1 - clamp(0, (var(--s2) - .47) / .08, 1)); }
.lm-mode-tabs span:nth-child(3)::before { opacity: clamp(0, (var(--s2) - .47) / .08, 1); }
.lm-workspaces { position: relative; min-height: 0; }
.lm-code-workspace, .lm-ink-workspace { position: absolute; inset: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel-2); }
.lm-code-workspace { --k: clamp(0, (var(--s2) - .16) / .08, 1); --leave: clamp(0, (var(--s2) - .47) / .08, 1); opacity: calc(var(--k) * (1 - var(--leave))); transform: translateY(calc((1 - var(--k)) * -60px - var(--leave) * 60px)); }
.lm-code-workspace pre { margin: 18px 0; font: 400 20px/1.6 var(--mono); white-space: pre-wrap; }
.lm-run-result { --k: clamp(0, (var(--s2) - .26) / .08, 1); display: block; padding-top: 12px; border-top: 1px solid var(--line); opacity: var(--k); transform: translateY(calc((1 - var(--k)) * -40px)); }
.lm-ink-workspace { --k: clamp(0, (var(--s2) - .47) / .08, 1); opacity: var(--k); transform: translateY(calc((1 - var(--k)) * 60px)); }
.lm-ink-workspace svg { display: block; width: min(420px, 100%); height: calc(100% - 26px); margin-inline: auto; color: var(--text); }
.lm-ink-workspace path { stroke-dasharray: 1; stroke-dashoffset: calc(1 - clamp(0, (var(--s2) - .51) / .12, 1)); }
.lm-check-verdict { --k: clamp(0, (var(--s2) - .76) / .08, 1); display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-inline-start: 3px solid var(--good); background: var(--panel-2); border-radius: var(--radius-md); font-size: 16px; line-height: 1.4; opacity: var(--k); transform: translateY(calc((1 - var(--k)) * -48px)); }.lm-check-verdict .ui-icon { flex: none; }
.lm-export-scene { --show: clamp(0, (var(--s3) - .126) / .174, 1); }
.lm-export-document-title { display: block; font-size: 26px; line-height: 1.3; padding-top: 14px; max-width: 55%; }
/* The export dropdown hangs from the window's "Экспорт" button, outside the clipped content area. */
.lm-export-menu { --open: clamp(0, (var(--s3) - .126) * 5, 1); position: absolute; top: 42px; right: 24px; opacity: clamp(0, (var(--s3) - .126) / .174, 1); z-index: 2; display: grid; gap: 4px; padding: 8px; width: 180px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel-3); transform-origin: 100% 0; transform: translateY(calc((1 - var(--open)) * -40px)) scaleY(calc(.9 + var(--open) * .1)); }
.lm-export-menu span { --k: clamp(0, (var(--s3) - .2) * 5 - var(--i) * .5, 1); display: flex; align-items: center; gap: 10px; padding: 12px; font-size: 15px; opacity: var(--k); transform: translateY(calc((1 - var(--k)) * -48px)); }
.lm-print-page { --print: clamp(0, (var(--s3) - .4) / .26, 1); position: absolute; top: 18%; left: 9%; width: 64%; height: 70%; display: grid; align-content: start; gap: 16px; padding: 28px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--panel-2); clip-path: inset(0 0 calc((1 - var(--print)) * 100%) 0); transform: translateY(calc(var(--print) * 64px)); font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.lm-print-page strong { font-size: 24px; line-height: 1.3; }.lm-print-page .callout-formula { padding: 10px; font-size: 17px; }.lm-print-line { height: 2px; background: var(--line-2); width: 85%; }.lm-print-line:last-child { width: 65%; }
@media (max-width: 850px) { .lm { --lm-pin: 56px; } html.lm-landing { scroll-padding-top: 72px; } }
@media (max-width: 600px) {
 .lm-a-pin { grid-template-rows: 60px 3px 44px minmax(0, 1fr); gap: 10px; }
 .lm-navigation button { flex: 1; padding-inline: 7px; font-size: 13px; }
 .lm-window { grid-template-rows: 42px 36px minmax(0, 1fr); border-radius: 18px; }
 .lm-app-bar { padding: 6px 12px; font-size: 12px; gap: 6px; }.lm-export-trigger { padding: 6px 8px; }
 .lm-app-tabs { padding-inline: 8px; font-size: 12px; gap: 0; }.lm-app-tabs span { flex: 1; text-align: center; padding: 5px; }
 .lm-scene { inset: 12px 14px 16px; }
 .lm .callout-formula { padding: 12px; font-size: 16px; }.lm-meta { font-size: 12px; }
 .lm-practice { gap: 12px; }.lm-question { padding: 14px; gap: 6px; }.lm-question strong { font-size: 18px; }.lm-practice-answer { padding: 12px 14px; }.lm-practice-answer p { font-size: 15px; }.lm-practice-verdict { padding: 12px 14px; gap: 6px; }.lm-practice-verdict strong { font-size: 15px; }.lm-practice-verdict p { font-size: 14px; }
 .lm-check { gap: 12px; }.lm-mode-tabs span { padding: 8px 4px; font-size: 12px; }.lm-code-workspace,.lm-ink-workspace { padding: 16px; }.lm-code-workspace pre { font-size: 17px; }.lm-check-verdict { font-size: 14px; padding: 12px; }
 .lm-export-menu { width: 132px; top: 32px; right: 14px; }.lm-export-menu span { font-size: 13px; padding: 10px; }.lm-export-document-title { font-size: 19px; max-width: 48%; }
 .lm-print-page { left: 3%; width: 90%; padding: 20px; gap: 12px; font-size: 14px; }.lm-print-page strong { font-size: clamp(16px, 5.2vw, 20px); } /* «последовательностей» stays whole at 320px */
}
@media (max-width: 600px) and (max-height: 700px) { .lm-secondary { display: none; }.lm-reader-body { gap: 10px; }.lm-question > .lm-meta { display: none; }.lm-question,.lm-practice-answer,.lm-practice-verdict { padding: 10px 12px; }.lm-print-page { gap: 10px; }.lm-print-line { display: none; } }
@media (max-width: 360px) { .lm-navigation { gap: 4px; }.lm-navigation button { padding-inline: 3px; font-size: 12px; }.lm-caption h3 { font-size: 20px; }.lm-app-tabs span { padding-inline: 2px; font-size: 11px; } }
/* Final frames replace spatial choreography; scene opacity still cross-fades with the scroll. */
@media (prefers-reduced-motion: reduce) {
 .lm-rail span::after { transform: none; opacity: var(--fill); }
 .lm-window,.lm-caption,.lm-scene,.lm-question,.lm-practice-verdict,.lm-mode-tabs span,.lm-code-workspace,.lm-ink-workspace,.lm-run-result,.lm-check-verdict,.lm-export-menu,.lm-export-menu span,.lm-print-page { transform: none !important; }
 .lm-question,.lm-practice-verdict,.lm-mode-tabs span,.lm-run-result,.lm-check-verdict,.lm-export-menu span,.lm-ink-workspace { opacity: 1; }
 .lm-code-workspace { opacity: 0; }.lm-practice-answer p,.lm-print-page { clip-path: none; }.lm-ink-workspace path { stroke-dashoffset: 0; }.lm-window { opacity: 1; }
}
/* Print: no scroll runways (the explainer and B print their first frame once, without blank pages). */
@media print { #landing-view.lm-on .ls { height: auto; }#landing-view.lm-on .ls-grid { position: static; }#landing-view .lm-b { height: auto; }#landing-view .lm-b-pin { position: static; }.lm-toc-list li,.lm-reader .summary-overview { opacity: 1 !important; clip-path: none !important; }.lm-close-piece { opacity: 1 !important; transform: none !important; }.lm-a { height: auto; }.lm-a-pin { position: static; height: auto; display: block; }.lm-navigation,.lm-rail { display: none; }.lm-window { height: 700px; transform: none !important; opacity: 1 !important; } }
/* Movement B: a single recording follows the real queue/status path. */
#landing-view #privacy-block.lm-enabled { display: block; padding-block: 24px; text-align: start; }
.lm-b { --lm-height: min(630px, calc(100svh - var(--lm-pin) - 16px)); height: calc(var(--lm-height) + 196vh); --lit1: 0; --lit2: 0; --journey: 0; --crack: 0; --separate: 0; --drop: 0; --fade: 0; --ready: 0; --audio-travel: 0px; --fall-distance: 120px; }
.lm-b-pin { overflow: clip; position: sticky; top: var(--lm-pin); height: var(--lm-height); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(32px, 6vw, 80px); }
.lm-privacy-copy { display: grid; align-content: center; gap: 24px; min-width: 0; }
.lm-privacy-copy .lm-heading { margin: 0; font-size: clamp(30px, 3.4vw, 44px); }
.lm-privacy-sentences { margin: 0; padding: 0; list-style: none; display: grid; gap: 16px; }
.lm-privacy-sentences li { color: var(--muted); font: 400 18px/1.5 var(--display); }
#landing-view .lm-privacy-copy .policy-link { margin: 0; justify-self: start; display: inline-flex; align-items: center; min-height: 44px; }
.lm-queue { overflow: clip; align-self: stretch; position: relative; min-height: 0; border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--panel); }
.lm-status-path { position: absolute; inset: 24px 24px 40px 28px; border-inline-start: 2px solid var(--line-2); }
.lm-status-fill { position: absolute; inset: 0 auto 0 -2px; width: 2px; background: var(--signal); transform-origin: 50% 0; transform: scaleY(calc(var(--journey) * .65 + var(--ready) * .35)); }
.lm-status-stop { position: absolute; inset-inline-start: -7px; display: flex; align-items: center; gap: 18px; font-size: 14px; }
.lm-status-stop > i { flex: none; width: 12px; height: 12px; border: 2px solid var(--field-line); border-radius: 50%; background: var(--panel); }
.lm-stop-upload { top: 0; }.lm-stop-process { top: 35%; }.lm-stop-ready { top: 65%; }
.lm-stop-process .status-chip { opacity: var(--lit1); }.lm-stop-ready .status-chip { opacity: var(--lit2); }
.lm-status-stop .status-chip { min-height: 30px; margin: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); color: var(--text); }
.lm-queue .lecture-row { position: absolute; inset-inline: 56px 24px; display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line-2); border-radius: var(--radius-md); background: var(--panel-2); }
.lm-queue .lecture-row-icon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; }
.lm-row-copy { min-width: 0; display: grid; gap: 8px; }.lm-row-copy strong { font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }.lm-row-copy > span { font-size: 14px; line-height: 1.4; color: var(--muted); }
/* Complementary immutable masks keep the native card whole until the crack opens. */
.lm-recording { position: absolute; top: 64px; inset-inline: 56px 24px; height: 90px; transform: translateY(calc(var(--journey) * var(--audio-travel))); }
.lm-recording .lecture-row { inset: 0; }
.lm-audio-half { --split-drift: 12px; --split-angle: 4deg; opacity: calc(1 - var(--fade)); transform: translate(calc(var(--direction) * var(--separate) * var(--split-drift)), calc(var(--drop) * var(--fall-distance))) rotate(calc(var(--direction) * var(--separate) * var(--split-angle))); }
.lm-half-left { --direction: -1; clip-path: polygon(0 0, 54% 0, 47% 28%, 55% 50%, 44% 73%, 50% 100%, 0 100%); }
.lm-half-right { --direction: 1; clip-path: polygon(54% 0, 100% 0, 100% 100%, 50% 100%, 44% 73%, 55% 50%, 47% 28%); }
.lm-recording-crack { position: absolute; inset: 0; background: var(--muted); clip-path: polygon(54% 0, calc(54% + 1px) 0, calc(47% + 1px) 28%, calc(55% + 1px) 50%, calc(44% + 1px) 73%, calc(50% + 1px) 100%, 50% 100%, 44% 73%, 55% 50%, 47% 28%); opacity: calc(var(--crack) * (1 - clamp(0, var(--separate) * 4, 1))); }
.lm-summary-row { bottom: 24px; opacity: var(--ready); transform: translateY(calc((1 - var(--ready)) * 40px)); }
.lm-owner-label { display: flex; align-items: center; gap: 8px; opacity: var(--ready); }
.lm-lock { position: relative; width: 14px; height: 12px; flex: none; border: 1.5px solid currentColor; border-radius: 2px; margin-top: 6px; }
.lm-lock::before { content: ""; position: absolute; top: -8px; left: 2px; width: 7px; height: 7px; border: 1.5px solid currentColor; border-bottom: 0; border-radius: 6px 6px 0 0; }
@media (max-width: 850px) {
 .lm-b-pin { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 20px; }
 .lm-audio-half { --split-drift: 6px; --split-angle: 3deg; }
 .lm-privacy-copy { gap: 14px; }.lm-privacy-copy .lm-heading { font-size: 30px; }.lm-privacy-sentences { gap: 8px; }.lm-privacy-sentences li { font-size: 16px; line-height: 1.4; }
 .lm-queue { border-radius: 18px; }.lm-status-path { inset: 16px 16px 24px 20px; }.lm-status-stop { gap: 12px; }.lm-status-stop .status-chip { font-size: 12px; padding: 5px 8px; }
 .lm-queue .lecture-row { inset-inline: 42px 14px; padding: 12px; gap: 10px; }.lm-row-copy strong { font-size: 15px; }.lm-row-copy > span { font-size: 12px; }.lm-recording { top: 52px; inset-inline: 42px 14px; height: 76px; }.lm-summary-row { bottom: 14px; }.lm-queue .lecture-row-icon { width: 34px; height: 34px; }
}
/* 320px phones: the lecture title's long word fits whole, so the summary card stays two lines and clear of the chips. */
@media (max-width: 340px) {
 .lm-queue .lecture-row,.lm-recording { inset-inline: 38px 10px; }.lm-queue .lecture-row { gap: 8px; }.lm-row-copy strong { font-size: 14px; }
}
@media (max-width: 600px) and (max-height: 700px) {
 .lm-b-pin { gap: 14px; }.lm-privacy-copy { gap: 8px; }.lm-privacy-copy .lm-heading { font-size: 26px; }.lm-privacy-sentences { gap: 5px; }.lm-privacy-sentences li { font-size: 14px; line-height: 1.35; }
 .lm-row-copy { gap: 5px; }.lm-status-stop .status-chip { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
 .lm-status-fill { transform: none; }.lm-recording { transform: none; }.lm-half-left { clip-path: none; transform: none; opacity: calc(1 - var(--ready)); }.lm-recording .lm-half-right,.lm-recording-crack { display: none; }.lm-summary-row { transform: none; }
}
/* Movement C: a quiet, normal-flow invitation; no decorative subject replicas. */
#landing-view .wl-cta.lm-enabled { padding: 40px 0; margin-bottom: 32px; background: transparent; text-align: start; }
.lm-c { display: grid; gap: 20px; max-width: 700px; }
.lm-c .lm-heading { margin: 0; }
.lm-c p { margin: 0; max-width: 45ch; color: var(--muted); font: 400 18px/1.5 var(--display); }
.lm-c .wl-note { font-size: 14px; }
.lm-c .wl-actions { justify-content: start; margin: 0; }
.lm-c .btn { min-height: 44px; }
.lm-close-piece { --k: clamp(0, (var(--p) - var(--i) * .13) / .27, 1); opacity: var(--k); transform: translateY(calc((1 - var(--k)) * 12px)); }
.lm-c .wl-actions:focus-within { opacity: 1; transform: none; }
/* The marked phrase never wraps; on phones the heading scales so «на ближайшей лекции» fits a 320px screen. */
@media (max-width: 600px) { .lm-c .lm-heading { font-size: clamp(24px, 8.1vw, 30px); }.lm-c { gap: 16px; }.lm-c p { font-size: 16px; }.lm-c .wl-note { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .lm-close-piece { opacity: 1; transform: none; } }
