/* lesson-mode.css - interactive lesson player (post_type: LESSON).
 *
 * The player is a full-screen overlay (.lm-app) that lesson-mode.js builds and
 * fills with the .lesson-step nodes. With no JS, none of this applies and the
 * steps render as a normal, crawlable document inside #content. */

:root {
  --lm-bg: #eef2f7; --lm-panel: #fff; --lm-ink: #131720; --lm-body: #434b59;
  --lm-mut: #677084; --lm-faint: #97a0b2; --lm-line: #e0e6ef; --lm-line2: #eef1f6;
  --lm-accent: #1f7a55; --lm-c0: #2563a8; --lm-c1: #b5631a; --lm-bad: #c2410c;
  --lm-code: #0d1117;
  --lm-sh1: 0 1px 2px rgba(19,23,32,.04), 0 6px 16px -8px rgba(19,23,32,.10);
  --lm-sh2: 0 24px 56px -28px rgba(19,23,32,.30), 0 4px 12px rgba(19,23,32,.05);
  --lm-serif: "IBM Plex Serif", Georgia, serif;
}

/* Flash guard: hide the raw server-rendered document until the player overlay is
   built. The inline head script adds .lm-boot before first paint; lesson-mode.js
   removes it after the first render. The page shows the player bg meanwhile, so
   navigating between lessons never flashes the underlying site. No-JS never sets
   .lm-boot, so the steps stay visible and crawlable. */
html.lm-boot { background: var(--lm-bg); }
html.lm-boot body { visibility: hidden; }

/* Full-screen lock once the player is live. */
body.lesson-mode.lesson-js-ready { overflow: hidden; }
/* The underlying server-rendered page (masthead, sidebar, footer, Continue-Reading
   cross-links) stays in the DOM for crawlers / no-JS, but must not paint behind the
   overlay or add layout once the player is live. */
body.lesson-mode.lesson-js-ready .continue-reading-block,
body.lesson-mode.lesson-js-ready .continue-chip,
body.lesson-mode.lesson-js-ready #auto-further-reading,
/* The original page wrapper + footer stay in the DOM (crawlable / no-JS) but in
   normal flow they make the body taller than the viewport, and overflow:hidden does
   NOT stop programmatic scroll - so the page could scroll ~384px behind the fixed
   player, exposing the old page content + footer ("scrolls to the next lesson").
   Remove them from flow once the player is live so the page itself cannot scroll;
   the only scroller is the player's own .lm-stage. The full-screen sign-in nudge and
   the reading-progress bar are likewise meaningless over a lesson. */
body.lesson-mode.lesson-js-ready > .container,
body.lesson-mode.lesson-js-ready > footer,
body.lesson-mode.lesson-js-ready > .lv2-progress,
body.lesson-mode.lesson-js-ready .rs-nudge { display: none !important; }

.lm-app {
  position: fixed; top: 0; left: 0; right: 0;
  height: 100vh; height: 100dvh;   /* dvh tracks the real viewport so the bottom stepper is never hidden behind mobile browser UI */
  z-index: 2000; display: flex; flex-direction: column;
  background: var(--lm-bg); color: var(--lm-body);
  font-family: "IBM Plex Sans", system-ui, sans-serif; font-size: 17px; line-height: 1.7;
}

/* ---- two-pane body: course rail (left) + main (right) ---- */
.lm-body { flex: 1; display: flex; min-height: 0; position: relative; }
.lm-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.lm-rail { flex: 0 0 264px; overflow-y: auto; background: var(--lm-panel); border-right: 1px solid var(--lm-line); }
.lm-rail:empty { display: none; }   /* no course data -> single column, exactly like before */
.lm-rail-head { padding: 16px 18px 11px; border-bottom: 1px solid var(--lm-line2); }
.lm-rail-title { display: block; font-family: var(--lm-serif); font-weight: 600; font-size: 14px; color: var(--lm-ink); line-height: 1.35; }
.lm-rail-prog { display: block; margin-top: 5px; font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--lm-mut); }
.lm-rail-list { list-style: none; margin: 0; padding: 8px; }
.lm-rail-list li { margin: 0; }
.lm-rail-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; text-decoration: none; color: var(--lm-body); font-size: 13.5px; line-height: 1.3; }
a.lm-rail-item:link, a.lm-rail-item:visited { color: var(--lm-body); }
a.lm-rail-item:hover, a.lm-rail-item:focus { background: var(--lm-line2); color: var(--lm-ink); }
.lm-rail-item.current { background: color-mix(in srgb, var(--lm-accent) 10%, #fff); color: var(--lm-ink); font-weight: 600; cursor: default; }
.lm-rail-item.soon { color: var(--lm-faint); cursor: default; }
.lm-rail-mk { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--lm-line); display: flex; align-items: center; justify-content: center; font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--lm-faint); }
.lm-rail-item.current .lm-rail-mk { border-color: var(--lm-accent); color: var(--lm-accent); }
.lm-rail-mk.done { border-color: var(--lm-accent); background: var(--lm-accent); color: #fff; }
.lm-rail-tx { flex: 1; min-width: 0; }
.lm-rail-badge { flex: none; font-family: "IBM Plex Mono", monospace; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--lm-mut); border: 1px solid var(--lm-line); border-radius: 5px; padding: 2px 5px; }

/* ---- drill-up rail: section + track levels ---- */
.lm-rail-up { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; cursor: pointer; padding: 0 0 10px; margin: 0; font: inherit; font-size: 12px; font-weight: 600; color: var(--lm-mut); }
.lm-rail-up:hover { color: var(--lm-ink); }
.lm-rail-up svg { width: 15px; height: 15px; }
.lm-rail-eyebrow { display: block; font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--lm-faint); margin-bottom: 4px; }
.lm-rail-course { padding: 4px 0 8px; }
.lm-rail-course + .lm-rail-course { border-top: 1px solid var(--lm-line2); margin-top: 4px; }
.lm-rail-csub { padding: 9px 10px 2px; font-family: var(--lm-serif); font-weight: 600; font-size: 12.5px; color: var(--lm-ink); display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.lm-rail-csub span { font-family: "IBM Plex Mono", monospace; font-weight: 500; font-size: 10.5px; color: var(--lm-faint); }
.lm-rail-secrow { width: 100%; text-align: left; background: none; border: 0; cursor: pointer; font: inherit; font-size: 13.5px; color: var(--lm-body); }
.lm-rail-secrow:hover { background: var(--lm-line2); color: var(--lm-ink); }
.lm-rail-secrow.current { background: color-mix(in srgb, var(--lm-accent) 10%, #fff); color: var(--lm-ink); font-weight: 600; }
.lm-rail-sub { display: block; font-family: "IBM Plex Mono", monospace; font-size: 10px; color: var(--lm-faint); font-weight: 400; margin-top: 2px; }
.lm-rail-chev { flex: none; width: 15px; height: 15px; color: var(--lm-faint); }
.lm-rail-foot { display: block; padding: 12px 16px; border-top: 1px solid var(--lm-line2); font-size: 12.5px; font-weight: 600; color: var(--lm-mut); text-decoration: none; }
.lm-rail-foot:link, .lm-rail-foot:visited { color: var(--lm-mut); }
.lm-rail-foot:hover, .lm-rail-foot:focus { color: var(--lm-ink); }

/* ---- dark side rail: recolor the palette scoped to .lm-rail so every child
   inherits colours readable on the dark #08203d surface (border-right, marks,
   badges, hover/current states all resolve from these vars) ---- */
.lm-rail {
  background: #08203d;
  --lm-panel: #08203d; --lm-ink: #f4f8fd; --lm-body: #c6d5e8;
  --lm-mut: #93a8c2; --lm-faint: #7690ad;
  --lm-line: rgba(255,255,255,.16); --lm-line2: rgba(255,255,255,.09);
  --lm-accent: #46c08a;
}
/* .current mixes the accent with #fff (a light chip) - wrong on a dark rail;
   mix with the rail instead so the highlight stays dark with light text. */
.lm-rail-item.current, .lm-rail-secrow.current {
  background: color-mix(in srgb, var(--lm-accent) 24%, transparent);
}

/* ---- top-bar buttons added for the rail / fullscreen ---- */
.lm-rail-toggle { display: none; background: none; border: 0; cursor: pointer; color: var(--lm-mut); padding: 4px; align-items: center; }
.lm-rail-toggle svg { width: 20px; height: 20px; }
.lm-fs { background: none; border: 0; cursor: pointer; color: var(--lm-mut); padding: 4px; display: inline-flex; align-items: center; }
.lm-fs:hover { color: var(--lm-ink); }
.lm-fs svg { width: 17px; height: 17px; }

/* ---- mobile: rail becomes a slide-in drawer ---- */
@media (max-width: 860px) {
  .lm-app.lm-has-rail .lm-rail-toggle { display: inline-flex; }
  .lm-rail { position: absolute; top: 0; bottom: 0; left: 0; z-index: 12; width: 280px; max-width: 84vw;
    transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--lm-sh2); }
  .lm-app.rail-open .lm-rail { transform: none; }
}

/* ---- narrow phones: keep the top bar to a single row (no 'Get certified' wrap) ---- */
@media (max-width: 560px) {
  .lm-top { padding: 0 12px; gap: 10px; }
  /* the lesson title must be allowed to shrink so the right-hand cluster never gets squeezed */
  .lm-title { min-width: 0; flex: 0 1 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .lm-top-right { gap: 10px; }
  .lm-stepn { white-space: nowrap; }
  .lm-cert { white-space: nowrap; padding: 6px 11px; font-size: 12px; }
}

/* ---- breadcrumb in the top bar (Roadmap > Track > Section > Lesson) ---- */
.lm-title.lm-crumbs { font-family: "IBM Plex Sans", system-ui, sans-serif; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lm-title.lm-crumbs a { color: var(--lm-mut); text-decoration: none; }
.lm-title.lm-crumbs a:hover, .lm-title.lm-crumbs a:focus { color: var(--lm-ink); }
.lm-sep { color: var(--lm-faint); }
.lm-crumb-cur { color: var(--lm-ink); font-weight: 600; }
.lm-crumb-les { color: var(--lm-faint); }
@media (max-width: 860px) { .lm-title.lm-crumbs a, .lm-title.lm-crumbs .lm-sep { display: none; } }

/* ---- completion-actions card (shown on the complete step, beside the content) ---- */
.lm-complete-actions { max-width: 620px; margin: 28px auto 0; padding: 22px 22px 24px; border: 1px solid var(--lm-line); border-radius: 16px; background: var(--lm-panel); box-shadow: var(--lm-sh1); text-align: center; }
.lm-ca-prog { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--lm-mut); margin-bottom: 15px; }
.lm-ca-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.lm-ca-next { font-size: 14.5px; font-weight: 600; color: #fff; background: var(--lm-accent); border-radius: 9px; padding: 11px 22px; text-decoration: none; }
.lm-ca-next:link, .lm-ca-next:visited, .lm-ca-next:hover, .lm-ca-next:focus, .lm-ca-next:active { color: #fff; }
.lm-ca-review { font: inherit; font-size: 13.5px; font-weight: 600; color: var(--lm-ink); background: none; border: 1.5px solid var(--lm-line); border-radius: 9px; padding: 10px 18px; cursor: pointer; }
.lm-ca-review:hover { border-color: var(--lm-accent); }
.lm-ca-back { font-size: 13.5px; font-weight: 600; color: var(--lm-mut); text-decoration: none; padding: 10px 14px; }
.lm-ca-back:link, .lm-ca-back:visited { color: var(--lm-mut); }
.lm-ca-back:hover, .lm-ca-back:focus { color: var(--lm-ink); }

/* No-JS / not-ready: keep steps visible (crawlable). */
.lm-app .lesson-step { display: none; }
.lm-app .lesson-step.on { display: block; animation: lm-fade .4s cubic-bezier(.2,.7,.3,1); }
@keyframes lm-fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---- top bar ---- */
.lm-top {
  flex: none; height: 56px; display: flex; align-items: center; gap: 14px;
  padding: 0 22px; background: var(--lm-panel); border-bottom: 1px solid var(--lm-line);
}
.lm-exit { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--lm-mut); background: none; border: 0; cursor: pointer; text-decoration: none; }
.lm-exit:link, .lm-exit:visited, .lm-exit:active { color: var(--lm-mut); }
.lm-exit:hover, .lm-exit:focus { color: var(--lm-ink); }
.lm-exit svg { width: 16px; height: 16px; }
.lm-title { font-family: var(--lm-serif); font-weight: 600; font-size: 15px; color: var(--lm-ink); }
.lm-title span { color: var(--lm-faint); font-weight: 400; font-family: inherit; }
.lm-top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.lm-stepn { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--lm-mut); }
.lm-stepn b { color: var(--lm-ink); }
.lm-cert { font-size: 13px; font-weight: 600; color: #fff; background: var(--lm-ink); border-radius: 8px; padding: 7px 14px; text-decoration: none; }
/* Pin all link states so the browser's :visited color cannot darken the label
   after the first click (it leaks through because UA a:visited outranks .lm-cert). */
.lm-cert:link, .lm-cert:visited, .lm-cert:hover, .lm-cert:focus, .lm-cert:active { color: #fff; }

/* ---- segmented progress ---- */
.lm-segs { flex: none; display: flex; gap: 4px; padding: 9px 22px; background: var(--lm-panel); border-bottom: 1px solid var(--lm-line); }
.lm-segs i { flex: 1; height: 5px; border-radius: 99px; background: var(--lm-line); transition: background .3s; }
.lm-segs i.done { background: var(--lm-accent); }
.lm-segs i.cur { position: relative; overflow: hidden; }
.lm-segs i.cur::after { content: ""; position: absolute; inset: 0; width: 55%; background: var(--lm-accent); border-radius: 99px; }

/* ---- stage ---- */
.lm-stage { flex: 1; overflow-y: auto; overflow-x: hidden; }
.lesson-step { max-width: 760px; margin: 0 auto; padding: 38px 26px 70px; }
.lesson-step-eyebrow { font-family: "IBM Plex Mono", monospace; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--lm-accent); font-weight: 600; }
.lesson-step h2 { font-family: var(--lm-serif); font-weight: 600; font-size: clamp(25px,3.4vw,33px); line-height: 1.14; letter-spacing: -.01em; color: var(--lm-ink); margin: 9px 0 0; }
.lesson-step h4 { font-family: var(--lm-serif); font-weight: 600; font-size: 19px; color: var(--lm-ink); margin: 22px 0 0; }
.lesson-step p { margin: 15px 0 0; font-size: 17px; color: var(--lm-body); }
.lesson-step ul, .lesson-step ol { margin: 14px 0 0; padding-left: 22px; }
.lesson-step li { margin: 7px 0; }
.lesson-step strong { color: var(--lm-ink); font-weight: 600; }
.lesson-step code { font-family: "IBM Plex Mono", monospace; font-size: .85em; background: #e6ebf3; color: #243349; padding: .12em .42em; border-radius: 5px; }
.lesson-step pre code { background: none; padding: 0; }

/* callouts (lesson pages don't load engagement.css, so style them here) */
.lesson-step .callout { margin: 20px 0 0; border-radius: 12px; padding: 15px 18px 15px 20px; border: 1px solid var(--lm-line); background: var(--lm-panel); position: relative; box-shadow: var(--lm-sh1); }
.lesson-step .callout::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 12px 0 0 12px; background: var(--lm-c0); }
.lesson-step .callout-warning::before { background: var(--lm-bad); }
.lesson-step .callout-insight::before { background: #9a7320; }
.lesson-step .callout-tip::before { background: var(--lm-accent); }
.lesson-step .callout-label { font-family: "IBM Plex Mono", monospace; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--lm-mut); margin: 0 0 5px; }
.lesson-step .callout-body { font-size: 14.5px; }

/* ---- quiz ---- */
.lesson-quiz { margin: 22px 0 0; }
.lesson-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--lm-panel); border: 1.5px solid var(--lm-line); border-radius: 13px; padding: 14px 17px; margin-top: 10px; cursor: pointer; font: inherit; font-size: 15.5px; color: var(--lm-ink); transition: .14s; }
.lesson-opt:hover { border-color: var(--lm-accent); }
.lesson-opt .lesson-opt-mk { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--lm-line); flex: none; display: flex; align-items: center; justify-content: center; font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--lm-faint); }
.lesson-quiz.answered .lesson-opt { cursor: default; }
.lesson-opt.correct { border-color: var(--lm-accent); background: color-mix(in srgb, var(--lm-accent) 7%, #fff); }
.lesson-opt.correct .lesson-opt-mk { border-color: var(--lm-accent); background: var(--lm-accent); color: #fff; }
.lesson-opt.wrong { border-color: var(--lm-bad); background: color-mix(in srgb, var(--lm-bad) 6%, #fff); }
.lesson-opt.wrong .lesson-opt-mk { border-color: var(--lm-bad); color: var(--lm-bad); }
.lesson-opt.dim { opacity: .5; }
.lesson-qfb { margin: 14px 0 0; font-size: 14.5px; padding: 14px 16px; border-radius: 12px; display: none; }
.lesson-qfb.show { display: block; }
.lesson-qfb-ok { background: color-mix(in srgb, var(--lm-accent) 8%, #fff); border: 1px solid color-mix(in srgb, var(--lm-accent) 28%, var(--lm-line)); }
.lesson-qfb-no { background: color-mix(in srgb, var(--lm-bad) 7%, #fff); border: 1px solid color-mix(in srgb, var(--lm-bad) 26%, var(--lm-line)); }

/* ---- try-it ---- */
.lesson-tryit { margin: 22px 0 0; border: 1px solid color-mix(in srgb, var(--lm-accent) 26%, var(--lm-line)); border-radius: 14px; padding: 16px 18px; background: var(--lm-panel); box-shadow: var(--lm-sh1); }
.lesson-tryit-input { width: 100%; font-family: "IBM Plex Mono", monospace; font-size: 14px; line-height: 1.6; color: #e6ebf2; background: var(--lm-code); border: 1px solid #1b212c; border-radius: 10px; padding: 12px 14px; resize: vertical; min-height: 84px; }
.lesson-tryit-input:focus { outline: none; border-color: var(--lm-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lm-accent) 22%, transparent); }
.lesson-tryit-actions { margin: 12px 0 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lesson-tryit-check { background: var(--lm-accent); color: #fff; border: 0; border-radius: 9px; padding: 10px 18px; font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.lesson-tryit-fb { font-size: 13.5px; font-weight: 600; display: none; }
.lesson-tryit-fb.show { display: inline; }
.lesson-tryit-ok { color: var(--lm-accent); }
.lesson-tryit-no { color: var(--lm-bad); }
.lesson-tryit-sol { margin: 12px 0 0; }
.lesson-tryit-sol summary { font-size: 13px; font-weight: 600; color: var(--lm-mut); cursor: pointer; }
.lesson-tryit-sol pre { margin: 10px 0 0; background: var(--lm-code); border-radius: 9px; padding: 12px 14px; overflow-x: auto; }
.lesson-tryit-sol code { color: #d7deea; background: none; font-family: "IBM Plex Mono", monospace; font-size: 13px; }

/* ---- widget shell + decision-region ---- */
.lesson-widget { margin: 22px 0 0; border: 1px solid var(--lm-line); border-radius: 16px; background: var(--lm-panel); box-shadow: var(--lm-sh2); padding: 18px 20px; }
.lw-ctrl { margin: 0 0 14px; }
.lw-ctrl-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--lm-mut); margin-bottom: 7px; }
.lw-ctrl-row b { font-family: "IBM Plex Mono", monospace; color: var(--lm-ink); font-size: 15px; }
.lw-slider { width: 100%; height: 5px; accent-color: var(--lm-accent); }
.lw-grid { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.lw-canvas-wrap { width: 300px; height: 300px; border-radius: 12px; overflow: hidden; border: 1px solid var(--lm-line); }
.lw-canvas { display: block; width: 300px; height: 300px; }
.lw-legend { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin: 10px 0 0; font-size: 12px; color: var(--lm-mut); }
.lw-k { display: inline-flex; align-items: center; gap: 6px; }
.lw-sw { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.lw-sw-ring { background: #fff; border: 2px solid var(--lm-mut); }
.lw-metrics { display: grid; gap: 10px; }
.lw-m { background: var(--lm-bg); border: 1px solid var(--lm-line); border-radius: 11px; padding: 12px 14px; }
.lw-v { font-family: var(--lm-serif); font-weight: 700; font-size: 23px; color: var(--lm-ink); }
.lw-m-train .lw-v { color: var(--lm-mut); }
.lw-m-test .lw-v { color: var(--lm-accent); }
.lw-k2 { font-family: "IBM Plex Mono", monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--lm-faint); margin-top: 2px; }
.lw-note { margin: 14px 0 0; font-size: 13px; color: var(--lm-mut); background: var(--lm-bg); border-radius: 10px; padding: 11px 14px; }
.lw-note b { color: var(--lm-ink); }
.lw-note.lw-over { background: color-mix(in srgb, var(--lm-bad) 8%, #fff); }
.lw-note.lw-good { background: color-mix(in srgb, var(--lm-accent) 9%, #fff); }
.lw-diagram { text-align: center; padding: 4px 0; }
@media (max-width: 560px) { .lw-grid { grid-template-columns: 1fr; } .lw-canvas-wrap, .lw-canvas { width: 100%; } }

/* ---- stepper ---- */
.lm-stepper { flex: none; background: var(--lm-panel); border-top: 1px solid var(--lm-line); padding: 11px 22px; padding-bottom: calc(11px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 14px; }
.lm-back { font: inherit; font-size: 14px; font-weight: 600; color: var(--lm-mut); background: none; border: 0; cursor: pointer; padding: 10px 6px; }
.lm-back[disabled] { opacity: .35; cursor: default; }
.lm-mid { margin: 0 auto; font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--lm-faint); }
.lm-cont { font: inherit; font-size: 15px; font-weight: 600; color: #fff; background: var(--lm-accent); border: 0; border-radius: 11px; padding: 12px 28px; cursor: pointer; transition: .18s; }
.lm-cont:hover { filter: brightness(1.06); }
.lm-cont[disabled] { background: var(--lm-line); color: var(--lm-faint); cursor: not-allowed; }

/* ---- completion + paywall ---- */
.lm-done-ic { width: 70px; height: 70px; border-radius: 50%; margin: 0 auto; background: linear-gradient(135deg, var(--lm-accent), #16a34a); display: flex; align-items: center; justify-content: center; color: #fff; }
.lm-done-ic svg { width: 34px; height: 34px; }
.lesson-step[data-step-type="complete"] { text-align: center; }
.lesson-step[data-step-type="cover"] h2 { font-size: clamp(28px,4.4vw,40px); }
.lm-paywall { max-width: 560px; margin: 30px auto; background: linear-gradient(120deg,#1a1408,#3a2c10); color: #f6efe0; border-radius: 18px; padding: 28px; text-align: center; box-shadow: var(--lm-sh2); }
.lm-paywall h3 { font-family: var(--lm-serif); font-weight: 600; font-size: 22px; color: #fff; margin: 0 0 8px; }
.lm-paywall p { color: #e4dcc8; font-size: 14.5px; margin: 0 0 16px; }
.lm-paywall a { display: inline-block; background: #f3d99a; color: #2a2008; font-weight: 700; font-size: 14px; border-radius: 11px; padding: 12px 24px; text-decoration: none; }
.lm-paywall a:link, .lm-paywall a:visited, .lm-paywall a:hover, .lm-paywall a:focus { color: #2a2008; }

/* ---- Pro gate v2: instant wall over a faded first-content-step teaser ---- */
.lm-stage.lm-gatelock { overflow: hidden; position: relative; }
.lesson-step.lm-teaser { opacity: .55; filter: blur(3px); pointer-events: none; user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 22%, transparent 92%);
  mask-image: linear-gradient(to bottom, #000 22%, transparent 92%); }
.lesson-step.lm-teaser-quiz { filter: blur(9px); }
.lm-gate { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; padding: 22px 16px; }
.lm-gate-card { max-width: 540px; width: 100%; background: #0c0e12; color: #e8eaee; border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 34px 32px 28px; text-align: center; box-shadow: 0 24px 60px rgba(8,10,14,.45); }
.lm-gate-lock { width: 44px; height: 44px; margin: 0 auto; border-radius: 12px; background: rgba(243,217,154,.09); display: flex; align-items: center; justify-content: center; }
.lm-gate-lock svg { width: 20px; height: 20px; color: #e8cd8e; }
.lm-gate-card h3 { font-family: 'Inter Tight', 'Inter', 'IBM Plex Sans', sans-serif; font-weight: 700; font-size: 24px; letter-spacing: -.01em; color: #fff; margin: 14px 0 6px; }
.lm-gate-pos { color: #8b929d; font-size: 13px; margin: 0 0 12px; }
.lm-gate-desc { color: #b9bfc9; font-size: 14.5px; line-height: 1.6; margin: 0 auto 22px; max-width: 46ch; }
.lm-gate-cta { display: inline-block; background: #e8cd8e; font-weight: 700; font-size: 14.5px; border-radius: 11px; padding: 13px 30px; text-decoration: none; transition: background .15s ease; }
.lm-gate-cta:link, .lm-gate-cta:visited, .lm-gate-cta:focus { color: #171204; }
.lm-gate-cta:hover { background: #f0d89e; color: #171204; }
.lm-gate-price { color: #b9bfc9; font-size: 13.5px; font-weight: 600; margin: 14px 0 2px; }
.lm-gate-fine { color: #7d848e; font-size: 12px; margin: 0 0 4px; }
.lm-gate-free { display: inline-block; margin-top: 14px; font-size: 13.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.lm-gate-free:link, .lm-gate-free:visited, .lm-gate-free:hover, .lm-gate-free:focus { color: #d6dae0; }
.lm-gate-back { display: inline-block; margin-top: 10px; font-size: 12.5px; text-decoration: none; }
.lm-gate-back:link, .lm-gate-back:visited { color: #7d848e; }
.lm-gate-back:hover, .lm-gate-back:focus { color: #d6dae0; }
.lm-segs.lm-gated, .lm-stepper.lm-gated { visibility: hidden; }
@media (max-width: 640px) { .lm-gate { align-items: flex-start; overflow-y: auto; } .lm-gate-card { margin: 12px 0; padding: 24px 18px; } }

/* ---- account gate (free course, lesson 3+, signed-out): warm, not a paywall ---- */
.lm-signin { max-width: 540px; margin: 34px auto; background: var(--lm-panel,#fff); border: 1px solid var(--lm-line,#e6e3da); border-radius: 18px; padding: 30px 28px; text-align: center; box-shadow: var(--lm-sh2); }
.lm-signin h3 { font-family: var(--lm-serif); font-weight: 600; font-size: 22px; color: var(--lm-ink,#1a1a1a); margin: 0 0 9px; }
.lm-signin p { color: var(--lm-mut,#5b6068); font-size: 14.5px; line-height: 1.55; margin: 0 auto 16px; max-width: 44ch; }
.lm-signin-cta { display: inline-block; background: var(--lm-accent,#1f7a55); color: #fff; font-weight: 700; font-size: 14.5px; border-radius: 11px; padding: 12px 24px; text-decoration: none; }
.lm-signin-cta:link, .lm-signin-cta:visited, .lm-signin-cta:hover, .lm-signin-cta:focus { color: #fff; }
.lm-signin-fine { font-size: 12.5px !important; color: var(--lm-mut,#8a8f97) !important; margin: 14px auto 0 !important; }
.lm-signin-back { display: inline-block; margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--lm-mut,#5b6068); text-decoration: none; }
.lm-signin-back:hover { color: var(--lm-ink,#1a1a1a); }

/* ---- decorrelation widget ---- */
.lw-toggle { display: inline-flex; border: 1px solid var(--lm-line); border-radius: 10px; overflow: hidden; }
.lw-toggle button { border: 0; background: var(--lm-panel); font: inherit; font-size: 13px; font-weight: 600; color: var(--lm-mut); padding: 9px 15px; cursor: pointer; }
.lw-toggle button.on { background: var(--lm-accent); color: #fff; }
.lw-dtrees { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 16px 0 0; }
.lw-dcard { border: 1px solid var(--lm-line); border-radius: 11px; background: var(--lm-bg); padding: 12px; text-align: center; }
.lw-dtn { font-family: "IBM Plex Mono", monospace; font-size: 9.5px; color: var(--lm-faint); text-transform: uppercase; letter-spacing: .05em; }
.lw-drl { font-family: "IBM Plex Mono", monospace; font-size: 9px; color: var(--lm-faint); margin: 8px 0 4px; }
.lw-droot { font-weight: 700; font-size: 13px; color: #fff; border-radius: 7px; padding: 5px 8px; display: inline-block; }
.lw-divmeter { display: flex; align-items: center; gap: 12px; margin: 16px 0 0; }
.lw-divlbl { font-size: 13px; color: var(--lm-mut); } .lw-divlbl b { color: var(--lm-ink); }
.lw-divtrack { flex: 1; height: 9px; background: var(--lm-line2); border-radius: 99px; overflow: hidden; }
.lw-divfill { display: block; height: 100%; background: var(--lm-accent); border-radius: 99px; transition: width .3s; }
.lw-divpv { font-family: "IBM Plex Mono", monospace; font-size: 13px; font-weight: 600; color: var(--lm-accent); width: 42px; text-align: right; }
@media (max-width: 520px) { .lw-dtrees { grid-template-columns: repeat(2,1fr); } }

/* ---- oob-tuner widget ---- */
.lw-dual { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 0 0 16px; }
@media (max-width: 520px) { .lw-dual { grid-template-columns: 1fr; } }
.lw-chartwrap { border: 1px solid var(--lm-line); border-radius: 12px; background: #fff; padding: 10px 8px 4px; }
.lw-oob { width: 100%; height: 228px; display: block; }
.lw-readout { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0 0; }
.lw-readout .lw-m { flex: 1; min-width: 120px; }
.lw-r-err .lw-v { color: var(--lm-bad); } .lw-r-acc .lw-v { color: var(--lm-accent); }
.lw-impbox { margin: 22px 0 0; border: 1px solid var(--lm-line); border-radius: 14px; background: var(--lm-panel); box-shadow: var(--lm-sh1); padding: 16px 18px; }
.lw-imph { font-family: var(--lm-serif); font-weight: 700; font-size: 14.5px; color: var(--lm-ink); margin: 0 0 12px; }
.lw-imp { display: grid; gap: 8px; }
.lw-improw { display: grid; grid-template-columns: 120px 1fr 40px; gap: 10px; align-items: center; }
.lw-impnm { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--lm-body); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lw-impbar { height: 15px; background: var(--lm-line2); border-radius: 5px; overflow: hidden; }
.lw-impfill { height: 100%; background: linear-gradient(90deg,#2f9e6c,var(--lm-accent)); border-radius: 5px; }
.lw-imppct { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--lm-mut); text-align: right; }
