/*
  A path's map with its stations, a group, a course's stages, the course list and the path test's hero, result and
  review. Loaded after pages.css on those pages (Looks/LearnStyles.cs). Split out of pages.css by LD2-0.
*/

/* ---------- Path: the world's map, with the courses as stations along a route ---------- */
.ln-pmap { position: relative; color: #fff; overflow: hidden; isolation: isolate; background: var(--w-deep); }
.ln-main > .ln-pmap { max-width: none; padding: 0; }
.ln-pmap-art { position: absolute !important; inset: 0; z-index: -2; }
.ln-pmap::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, color-mix(in srgb, var(--w-deep) 82%, transparent) 0%, color-mix(in srgb, var(--w-deep) 35%, transparent) 38%, color-mix(in srgb, var(--w-deep) 25%, transparent) 70%, color-mix(in srgb, var(--w-deep) 85%, transparent)), linear-gradient(90deg, color-mix(in srgb, var(--w-deep) 60%, transparent), transparent 60%); }
[dir="rtl"] .ln-pmap::after { transform: scaleX(-1); }
[dir="rtl"] .ln-pmap-art .ln-scene { transform: scaleX(-1); }
/* LD3: a slim header across the top, then the route and the chosen course's details side by side. */
.ln-pmap-in { position: relative; max-width: var(--ln-max); margin: 0 auto; padding: 18px 20px 24px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "head head" "board panel"; gap: 14px 28px; }
.ln-pmap-head { grid-area: head; display: grid; gap: 8px; }
.ln-pmap-head .ln-crumbs { margin-bottom: 0; }
.ln-pmap-headrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px 32px; }
.ln-pmap-id { display: grid; gap: 6px; min-width: 0; }
.ln-pmap-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ln-pmap-tags .ln-badge { padding: 3px 9px; font-size: 10.5px; box-shadow: none; }
.ln-pmap-head .ln-world-title { max-width: none; margin: 0; font-size: clamp(28px, 3vw, 40px); }
.ln-pmap-head .ln-world-sum { max-width: 78ch; font-size: 15px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ln-pmap-go { display: grid; justify-items: end; gap: 10px; }
.ln-pmap-go .ln-world-stats { margin-top: 0; gap: 4px 20px; font-size: 12px; }
.ln-pmap-go .ln-world-stats b { font-size: 24px; }
.ln-pmap-go .ln-world-stats small { font-size: 14px; }
.ln-pmap-go .ln-world-cta { margin-top: 0; }
.ln-pmap-go .ln-btn--big { min-height: 52px; padding: 12px 22px; font-size: 16px; }
.ln-pmap-board { grid-area: board; position: relative; min-height: 360px; margin: 6px 0 0; padding: 0 30px 24px; }
.ln-pmap-board > .ln-metaphor { position: absolute; inset-inline-start: 0; bottom: 0; margin: 0; font-size: 12.5px; opacity: .9; }
/* The route: a soft glow, the whole way dashed, and the part walked drawn in the world's light. */
.ln-pmap-route { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ln-pmap-route path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.ln-route-glow { stroke: var(--w-glow); stroke-width: 18px; opacity: .08; }
.ln-route-todo { stroke: rgba(255, 255, 255, .55); stroke-width: 3px; stroke-dasharray: 2 9; }
.ln-route-done { stroke: var(--w-glow); stroke-width: 5px; filter: drop-shadow(0 0 6px var(--w-glow)); }
@media (prefers-reduced-motion: no-preference) {
  .ln-route-done { animation: ln-route-draw 1.8s .3s var(--ln-ease) both; }
}
@keyframes ln-route-draw { from { stroke-dashoffset: var(--d); } to { stroke-dashoffset: 0; } }
.ln-pmap-route--tall { display: none; }
/* Right to left, the stations sit from the right (inset-inline-start), so the route is drawn mirrored to meet them. */
[dir="rtl"] .ln-pmap-route { transform: scaleX(-1); }
.ln-pmap-stops { position: absolute; inset: 0; }
.ln-stop { position: absolute; inset-inline-start: var(--x); top: var(--y); width: 0; height: 0; }
/* The node is the dot, centred on the route; its name hangs below (or above, every other station). */
.ln .ln-stop-node { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); display: block; }
[dir="rtl"] .ln .ln-stop-node { left: auto; right: 0; transform: translate(50%, -50%); }
.ln-stop-dot { position: relative; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff; background: color-mix(in srgb, var(--w-deep) 80%, #000); box-shadow: inset 0 0 0 2.5px rgba(255, 255, 255, .55), 0 8px 20px -6px rgba(0, 0, 0, .6); transition: transform .3s var(--ln-ease), box-shadow .3s; }
.ln-stop-dot .ln-emblem, .ln-stop-dot svg { width: 22px; height: 22px; }
.ln-stop-node:hover .ln-stop-dot, .ln-stop-node[aria-current] .ln-stop-dot { transform: scale(1.12); }
.ln-stop-node[aria-current] .ln-stop-dot { box-shadow: inset 0 0 0 2.5px #fff, 0 0 0 6px color-mix(in srgb, var(--w-glow) 35%, transparent), 0 8px 20px -6px rgba(0, 0, 0, .6); }
.ln-stop-label { position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 160px; text-align: center; padding: 4px 9px; border-radius: 10px; font-size: 12.5px; font-weight: 700; line-height: 1.25; background: color-mix(in srgb, var(--w-deep) 72%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.ln-stop.is-done .ln-stop-dot { background: linear-gradient(135deg, var(--w-accent), var(--w-glow)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--w-glow) 30%, transparent), 0 0 24px var(--w-glow); }
.ln-stop.is-done .ln-stop-dot .ln-emblem { stroke: var(--w-deep); stroke-width: 2.2; }
.ln-stop.is-current .ln-stop-dot { background: #fff; color: var(--w-deep); }
.ln-stop.is-current .ln-stop-dot::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--w-glow); }
@media (prefers-reduced-motion: no-preference) {
  .ln-stop.is-current .ln-stop-dot::before { animation: ln-stop-pulse 2.2s ease-out infinite; }
}
@keyframes ln-stop-pulse { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.ln-stop.is-current .ln-stop-label { background: var(--w-glow); color: var(--w-deep); text-shadow: none; }
.ln-stop.is-coming .ln-stop-dot { background: transparent; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5); border: 2px dashed transparent; opacity: .8; }
.ln-stop.is-optional { opacity: .7; }
.ln-stop--finish .ln-stop-dot { width: 58px; height: 58px; background: radial-gradient(circle, var(--w-glow), color-mix(in srgb, var(--w-glow) 40%, var(--w-deep))); }
.ln-stop--finish .ln-stop-dot svg { width: 30px; height: 30px; fill: var(--w-deep); }
.ln-stop--finish.is-coming .ln-stop-dot { background: color-mix(in srgb, var(--w-deep) 70%, #000); }
.ln-stop--finish.is-coming .ln-stop-dot svg { fill: rgba(255, 255, 255, .6); }
.ln-stop--finish.is-done .ln-stop-dot { box-shadow: 0 0 0 6px color-mix(in srgb, var(--w-glow) 35%, transparent), 0 0 40px var(--w-glow); }
/* The side panel: the station chosen (the current one at first). */
.ln-stop.is-up .ln-stop-label { top: auto; bottom: calc(100% + 8px); }
.ln-pmap-panel { grid-area: panel; align-self: start; position: relative; display: grid; align-content: start; padding: 14px; border-radius: 22px; color: var(--ln-ink); background: color-mix(in srgb, var(--ln-card) 90%, transparent); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(255, 255, 255, .25); }
.ln-pmap-close { display: none; }
.ln-stop-detail { display: grid; gap: 10px; outline: none; }
.ln-stop-detail[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .ln-stop-detail { animation: ln-detail-in .4s var(--ln-ease); }
}
@keyframes ln-detail-in { from { opacity: 0; transform: translateY(8px); } }
.ln-stop-cover { position: relative; aspect-ratio: 16 / 8; border-radius: 16px; overflow: hidden; background: var(--w-soft); box-shadow: 0 14px 30px -16px rgba(0, 0, 0, .6); }
.ln-stop-cover img, .ln-stop-cover .ln-scene-wrap { width: 100%; height: 100%; object-fit: cover; }
.ln-stop-cover .ln-ring { position: absolute; inset-inline-end: 10px; bottom: 10px; color: #fff; background: color-mix(in srgb, var(--w-deep) 80%, transparent); border-radius: 50%; }
.ln-stop-cover .ln-ring-fill { stroke: var(--w-glow); }
.ln-stop-detail h2 { font-family: var(--ln-display); font-weight: 600; font-size: 21px; line-height: 1.12; letter-spacing: -.015em; }
.ln-stop-detail p { font-size: 13.5px; line-height: 1.5; color: var(--ln-ink-2); }
.ln-stop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ln-stop-actions .ln-btn { min-height: 44px; padding: 10px 16px; font-size: 14px; }
.ln-station-kicker { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--w-ink); }
.ln-levels { display: flex; flex-wrap: wrap; gap: 5px; }
.ln-level-pip { font-size: 11px; font-weight: 750; padding: 3px 9px; border-radius: 999px; background: var(--ln-line); color: var(--ln-ink-2); }
.ln-level-pip.is-done { background: var(--ln-good); color: #fff; }
.ln-level-pip.is-locked { background: transparent; box-shadow: inset 0 0 0 1px var(--ln-line-2); color: var(--ln-muted); }
.ln-level-pip.is-locked::before { content: "🔒 "; font-size: 9px; }
/* Below the map: the test, the diplomas and the other paths of the world, side by side. */
.ln-path-below { max-width: var(--ln-max); margin: 20px auto 0; padding: 0 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.ln-side-card { padding: 20px; border-radius: var(--ln-r); background: var(--ln-card); box-shadow: var(--ln-shadow); display: grid; gap: 12px; }
.ln-side-card h3 { font-family: var(--ln-display); font-weight: 600; font-size: 22px; line-height: 1.15; }
.ln-side-card--test { background: radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--w-glow) 26%, transparent), transparent 60%), var(--ln-card); }
.ln-facts { display: grid; gap: 6px; font-size: 14px; color: var(--ln-ink-2); }
.ln-facts b { font-weight: 800; color: var(--ln-ink); }
.ln-side-note { font-size: 13px; color: var(--ln-muted); }
.ln-side-diplomas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ln-side-diplomas .ln-dip-title { font-size: 13px; }
.ln .ln-side-path { position: relative; display: flex; align-items: flex-end; min-height: 74px; padding: 10px 14px; border-radius: 14px; overflow: hidden; color: #fff; font-weight: 700; isolation: isolate; }
.ln-side-path + .ln-side-path { margin-top: 8px; }
.ln-side-path-art { position: absolute !important; inset: 0; z-index: -2; }
.ln-side-path::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, color-mix(in srgb, var(--w-deep) 90%, transparent), transparent); }
.ln-side-link { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--ln-line); font-weight: 650; }
.ln-gender-tag { justify-self: start; }

/* ---------- Course: a stage of its world ---------- */
/* The page is one grid (LD2-F): the head and the sample screen on the world's scene, the levels and the side below.
   The scene is the grid's first row, drawn to the window's edges; on a phone the sample comes after the levels. */
.ln-main:has(> .ln-cpage) { overflow-x: clip; }
.ln-main > .ln-cpage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); grid-template-areas: "head trailer" "learn learn" "side side" "stages stages" "also also"; column-gap: 36px; align-items: start; }
.ln-cpage-bg { grid-row: 1; grid-column: 1 / -1; align-self: stretch; position: relative; margin-inline: calc(50% - 50vw); margin-bottom: -56px; overflow: hidden; isolation: isolate; background: var(--w-deep); z-index: 0; }
.ln-course-art { position: absolute !important; inset: 0; z-index: -2; }
.ln-cpage-bg::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, color-mix(in srgb, var(--w-deep) 94%, transparent) 10%, color-mix(in srgb, var(--w-deep) 60%, transparent) 55%, color-mix(in srgb, var(--w-deep) 30%, transparent)), linear-gradient(0deg, color-mix(in srgb, var(--w-deep) 85%, transparent), transparent 45%); }
[dir="rtl"] .ln-cpage-bg::after { transform: scaleX(-1); }
[dir="rtl"] .ln-course-art .ln-scene { transform: scaleX(-1); }
.ln-course-head { grid-area: head; position: relative; z-index: 1; color: #fff; padding: 20px 0 80px; }
.ln-cpage > .ln-course-cover, .ln-cpage > .ln-trailer { grid-area: trailer; position: relative; z-index: 2; margin-top: 20px; align-self: start; }
/* The main column's parts sit straight on the page's grid, so the levels keep the page's full width. */
.ln-cpage-main { display: contents; }
.ln-cpage > .ln-cpage-main > * { position: relative; z-index: 1; min-width: 0; }
.ln-cpage .ln-learn-list { grid-area: learn; }
.ln-cpage .ln-stages { grid-area: stages; }
.ln-cpage .ln-also { grid-area: also; }
.ln-cpage-side { grid-area: side; position: relative; z-index: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.ln-course-title { font-family: var(--ln-display); font-weight: 600; font-size: clamp(30px, 3.3vw, 44px); line-height: 1.04; letter-spacing: -.022em; margin: 6px 0 8px; text-wrap: balance; text-shadow: 0 2px 30px rgba(0, 0, 0, .3); }
.ln-course-sum { font-size: 16px; line-height: 1.5; color: rgba(255, 255, 255, .88); max-width: 62ch; }
.ln-course-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ln-course-meta li { padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); font-size: 13px; font-weight: 650; backdrop-filter: blur(6px); }
.ln-course-cta { display: flex; align-items: center; gap: 18px; margin-top: 16px; color: #fff; }
.ln-course-cta .ln-ring { width: 62px; height: 62px; }
.ln-course-cta .ln-ring-fill { stroke: var(--w-glow); }
.ln-signature { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 20px; font-size: 13px; }
.ln-signature > span { opacity: .8; margin-inline-end: 4px; }
.ln-sig { padding: 4px 10px; border-radius: 8px; background: color-mix(in srgb, var(--w-glow) 22%, transparent); color: var(--w-glow); font-weight: 700; }
/* The cover, set into the scene as a lit panel that leans towards the reader. */
.ln-course-cover { position: relative; aspect-ratio: 4 / 3; border-radius: 24px; overflow: hidden; background: var(--w-soft); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .22), 0 0 70px -10px color-mix(in srgb, var(--w-glow) 45%, transparent); transform: perspective(900px) rotateY(-8deg) rotateX(2deg); transition: transform .8s var(--ln-ease); }
.ln-course-cover:hover { transform: perspective(900px) rotateY(-2deg); }
[dir="rtl"] .ln-course-cover { transform: perspective(900px) rotateY(8deg) rotateX(2deg); }
.ln-course-cover img, .ln-course-cover .ln-scene-wrap { width: 100%; height: 100%; object-fit: cover; }
.ln-course-cover-glow { position: absolute; inset: 0; background: linear-gradient(125deg, rgba(255, 255, 255, .28), transparent 35%), linear-gradient(0deg, color-mix(in srgb, var(--w-deep) 30%, transparent), transparent 40%); pointer-events: none; }
/* What you will learn: numbered chips, two or three to a row. */
.ln-learn-list { padding: 18px 20px 20px; border-radius: 24px; background: var(--ln-card); box-shadow: var(--ln-shadow-lift); }
.ln-learn-list .ln-h2 { margin: 0 0 12px; font-size: 20px; }
.ln-learn-list ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px; }
.ln-learn-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 14px; font-size: 14.5px; line-height: 1.4; background: color-mix(in srgb, var(--w-accent) 8%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--w-accent) 18%, transparent); }
.ln-learn-n { flex: none; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 900; color: #fff; background: var(--w-strong); }
/* The three levels as stages of one journey, joined by a route that fills as they are finished. */
.ln-stages { position: relative; display: grid; grid-template-columns: repeat(var(--stages, 3), minmax(0, 1fr)); gap: 16px; margin-top: 30px; padding-top: 30px; }
.ln-stages-route { position: absolute; top: 18px; inset-inline: calc(100% / var(--stages, 3) / 2); height: 4px; border-radius: 4px; background: repeating-linear-gradient(90deg, var(--ln-line-2) 0 8px, transparent 8px 14px); }
.ln-stages-route i { position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--done, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--w-accent), var(--w-glow)); box-shadow: 0 0 12px color-mix(in srgb, var(--w-glow) 70%, transparent); }
[dir="rtl"] .ln-stages-route i { background: linear-gradient(270deg, var(--w-accent), var(--w-glow)); }
.ln-stage { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 26px 18px 18px; border-radius: 22px; background: var(--ln-card); box-shadow: var(--ln-shadow); }
.ln-stage.is-done { box-shadow: 0 0 0 2px var(--ln-good), var(--ln-shadow); }
.ln-stage.is-next { box-shadow: 0 0 0 2px var(--w-accent), var(--ln-shadow-lift); }
.ln-stage-pin { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-family: var(--ln-display); font-size: 20px; font-weight: 600; color: var(--w-deep); background: var(--ln-card); box-shadow: inset 0 0 0 3px var(--ln-line-2), var(--ln-shadow); z-index: 1; }
.ln-stage.is-next .ln-stage-pin { background: var(--w-deep); color: var(--w-glow); box-shadow: 0 0 0 4px var(--w-accent), 0 0 0 9px color-mix(in srgb, var(--w-accent) 22%, transparent); }
.ln-stage.is-done .ln-stage-pin { background: linear-gradient(135deg, var(--w-accent), var(--w-glow)); box-shadow: 0 0 0 5px color-mix(in srgb, var(--w-glow) 30%, transparent); }
.ln-stage-pin .ln-emblem { width: 22px; height: 22px; stroke: var(--w-deep); stroke-width: 2.6; }
html[data-theme="dark"] .ln-stage-pin, .ln--teen .ln-stage-pin { color: var(--w-glow); }
.ln-stage-head { display: flex; gap: 12px; align-items: flex-start; }
.ln-stage-head > div { flex: 1; min-width: 0; }
.ln-stage-level { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--w-ink); display: flex; gap: 8px; align-items: center; }
.ln-free { font-size: 10.5px; padding: 2px 7px; border-radius: 6px; background: var(--ln-good-soft); color: var(--ln-good); letter-spacing: .04em; }
.ln-stage h3 { font-family: var(--ln-display); font-weight: 600; font-size: 20px; line-height: 1.2; margin-top: 2px; }
.ln-stage-count { text-align: end; font-size: 13px; font-weight: 700; color: var(--ln-muted); white-space: nowrap; }
.ln-stage-count b { font-size: 18px; color: var(--ln-ink); }
.ln-stage-count small { display: block; font-size: 11.5px; }
.ln-stage-meter { height: 6px; }
.ln-stage-sum { font-size: 13.5px; color: var(--ln-muted); }
.ln-lessons { display: grid; gap: 2px; }
.ln-lessons a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; transition: background .2s; }
.ln-lessons a:hover { background: color-mix(in srgb, var(--w-accent) 10%, transparent); }
.ln-lesson-mark { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900; box-shadow: inset 0 0 0 2px var(--ln-line-2); color: var(--ln-muted); }
.ln-lessons .is-done .ln-lesson-mark { background: var(--ln-good); color: #fff; box-shadow: none; }
.ln-lessons .is-next a { background: color-mix(in srgb, var(--w-accent) 12%, transparent); }
.ln-lessons .is-next .ln-lesson-mark { box-shadow: inset 0 0 0 2px var(--w-accent); background: radial-gradient(circle, var(--w-accent) 34%, transparent 38%); }
.ln-lesson-title { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; line-height: 1.3; }
.ln-lesson-kinds { display: flex; gap: 2px; flex: none; }
.ln-lesson-kind { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: var(--w-ink); background: color-mix(in srgb, var(--w-accent) 10%, transparent); }
.ln-lesson-kind .ln-emblem { width: 14px; height: 14px; stroke-width: 2; }
.ln-lesson-min { font-size: 12px; color: var(--ln-muted); font-weight: 700; min-width: 2.4em; text-align: end; }
.ln-quiz-row a { border: 1.5px dashed var(--ln-line-2); margin-top: 6px; }
.ln-quiz-row .ln-lesson-mark { box-shadow: inset 0 0 0 2px var(--w-accent); color: var(--w-ink); }
.ln-stage.is-locked .ln-lessons { filter: blur(1.5px); opacity: .45; pointer-events: none; user-select: none; }
.ln-also-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ln .ln-also-path { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-height: 110px; padding: 14px 18px; border-radius: 18px; color: #fff; overflow: hidden; isolation: isolate; background: var(--w-deep); box-shadow: var(--ln-shadow); transition: transform .3s var(--ln-ease); }
.ln-also-path:hover { transform: translateY(-3px); }
.ln-also-art { position: absolute !important; inset: 0; z-index: -2; }
.ln-also-path::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, color-mix(in srgb, var(--w-deep) 92%, transparent) 20%, transparent); }
.ln-also-path b { font-family: var(--ln-display); font-weight: 600; font-size: 19px; }
.ln-also-path span { font-size: 13px; opacity: .85; }

/* ---------- Course list ---------- */
.ln-filter input { margin-top: 16px; width: min(460px, 100%); padding: 13px 16px; border-radius: 14px; border: 1px solid var(--ln-line-2); background: var(--ln-card); color: var(--ln-ink); font-size: 15px; }
.ln-course-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-top: 26px; }
.ln-course-tile { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 18px; background: var(--ln-card); box-shadow: var(--ln-shadow); transition: transform .25s var(--ln-ease); }
.ln-course-tile:hover { transform: translateY(-3px); }
.ln-course-tile img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; background: var(--w-soft); }
.ln-course-tile b { font-family: var(--ln-display); font-weight: 600; font-size: 17px; line-height: 1.2; }
.ln-course-tile span { font-size: 13px; color: var(--ln-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Test hero, result and review ---------- */
.ln-result { display: flex; align-items: center; gap: 18px; margin-top: 18px; padding: 16px 20px; border-radius: 20px; background: rgba(0, 0, 0, .3); max-width: 480px; }
.ln-result .ln-ring { width: 76px; height: 76px; }
.ln-result .ln-ring b { font-size: 18px; }
.ln-result .ln-ring-fill { stroke: var(--w-glow); }
.ln-result > div { display: flex; flex-direction: column; }
.ln-result b { font-size: 22px; font-family: var(--ln-display); }
.ln-result.is-pass b { color: var(--w-glow); }
.ln-review-list { display: grid; gap: 10px; }
.ln-review-list li { display: flex; gap: 14px; padding: 16px; border-radius: 16px; background: var(--ln-card); box-shadow: var(--ln-shadow); }
.ln-review-mark { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 900; color: #fff; background: var(--ln-good); }
.ln-review-list .is-wrong .ln-review-mark { background: var(--ln-bad); }
.ln-review-list p { font-size: 14px; color: var(--ln-muted); margin-top: 4px; }
.ln-review-right { color: var(--ln-ink-2) !important; font-weight: 650; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1100px) {
  .ln-pmap-in { grid-template-columns: minmax(0, 1fr) 280px; }
  .ln-pmap-headrow { grid-template-columns: minmax(0, 1fr); }
  .ln-pmap-go { justify-items: start; grid-auto-flow: column; align-items: center; justify-content: space-between; }
}
@media (max-width: 960px) {
  .ln-main > .ln-cpage { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "learn" "stages" "trailer" "side" "also"; }
  .ln-cpage > .ln-course-cover { grid-row: 1; grid-area: auto; display: none; }
  .ln-cpage > .ln-trailer { margin-top: 26px; }
  .ln-course-head { padding-bottom: 76px; }
  .ln-stages { grid-template-columns: 1fr; gap: 34px; }
  .ln-stages-route { top: 30px; bottom: 30px; inset-inline-start: 50%; width: 4px; height: auto; background: repeating-linear-gradient(180deg, var(--ln-line-2) 0 8px, transparent 8px 14px); }
  .ln-stages-route i { width: auto; inset-inline: 0; height: var(--done, 0%); background: linear-gradient(180deg, var(--w-accent), var(--w-glow)); }
  /* The path map runs down the page: the route swings from side to side, one station a row, and the details open as a sheet. */
  .ln-pmap-in { grid-template-columns: 1fr; grid-template-areas: "head" "board"; min-height: 0; }
  .ln-pmap-board { min-height: calc(var(--rows, 6) * 96px); margin-top: 8px; padding: 0 0 30px; }
  .ln-pmap-route--wide { display: none; }
  .ln-pmap-route--tall { display: block; }
  .ln-stop { inset-inline-start: var(--tx); top: var(--ty); }
  .ln-stop .ln-stop-label, .ln-stop.is-up .ln-stop-label { top: 50%; bottom: auto; left: calc(100% + 12px); right: auto; transform: translateY(-50%); text-align: start; max-width: 150px; }
  .ln-stop.is-down .ln-stop-label { left: auto; right: calc(100% + 12px); text-align: end; }
  /* Right to left the route is mirrored, so each name sits on the other side of its station (LD3: none cut off). */
  [dir="rtl"] .ln-stop .ln-stop-label, [dir="rtl"] .ln-stop.is-up .ln-stop-label { left: auto; right: calc(100% + 12px); text-align: start; }
  [dir="rtl"] .ln-stop.is-down .ln-stop-label { right: auto; left: calc(100% + 12px); text-align: end; }
  .ln-pmap::after { background: linear-gradient(180deg, color-mix(in srgb, var(--w-deep) 88%, transparent), color-mix(in srgb, var(--w-deep) 55%, transparent) 30%, color-mix(in srgb, var(--w-deep) 65%, transparent)); }
  .ln-pmap-panel { position: fixed; z-index: 60; inset: auto 0 0 0; max-height: 78vh; overflow-y: auto; border-radius: 26px 26px 0 0; padding: 26px 18px calc(18px + env(safe-area-inset-bottom)); transform: translateY(105%); visibility: hidden; transition: transform .4s var(--ln-ease), visibility 0s .4s; background: var(--ln-card); }
  .ln-pmap-panel.is-open { transform: none; visibility: visible; transition: transform .4s var(--ln-ease); }
  .ln-pmap-panel::before { content: ""; position: absolute; top: 9px; left: 50%; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: var(--ln-line-2); }
  .ln .ln-pmap-close { display: grid; place-items: center; position: absolute; top: 12px; inset-inline-end: 12px; width: 40px; height: 40px; border-radius: 12px; background: var(--ln-line); }
  .ln-pmap-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; fill: none; }
  /* Without scripts the sheet never opens, so the chosen station's details stay in the page. */
  .ln-pmap:not(.is-live) .ln-pmap-panel { position: static; transform: none; visibility: visible; border-radius: 22px; margin-top: 12px; }
}
@media (max-width: 620px) {
  .ln-pmap-in { padding: 12px 14px 18px; }
  .ln-pmap-head .ln-world-title { font-size: 27px; }
  .ln-pmap-head .ln-world-sum { font-size: 14px; -webkit-line-clamp: 3; }
  .ln-pmap-go { grid-auto-flow: row; justify-content: stretch; }
  .ln-pmap-go .ln-world-stats b { font-size: 19px; }
  .ln-pmap-go .ln-world-stats small { font-size: 12px; }
  .ln-pmap-go .ln-world-cta, .ln-pmap-go .ln-world-cta .ln-btn { width: 100%; justify-content: center; }
  .ln-stop-label { font-size: 12px; }
  /* Beside the progress ring there is room for the button's main words only. */
  .ln-course-head .ln-btn-sub { display: none; }
  .ln-lesson-kinds { display: none; }
}

/* ---------- LD2-F: the course page as a trailer ---------- */
/* The sample screen: a real lesson screen on a card that leans into the head, played in place. */
.ln-trailer { border-radius: 24px; background: var(--ln-card); color: var(--ln-ink); box-shadow: var(--ln-z2), 0 0 0 1px rgba(255, 255, 255, .2); overflow: hidden; transform: rotate(-.8deg); transition: transform .6s var(--ln-ease); }
.ln-trailer:hover, .ln-trailer:focus-within { transform: none; }
[dir="rtl"] .ln-trailer { transform: rotate(.8deg); }
.ln-trailer-top { display: grid; gap: 2px; padding: 12px 18px; background: color-mix(in srgb, var(--w-accent) 14%, var(--ln-card)); }
.ln-trailer-top b { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--w-ink); }
.ln-trailer-top span { font-size: 12.5px; font-weight: 650; color: var(--ln-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-trailer-screen { padding: 16px 18px 6px; max-height: 560px; overflow-y: auto; }
.ln-trailer-screen .ln-x, .ln-trailer-screen .ln-block { margin: 0; }
.ln-trailer-screen .ln-q { font-size: 15px; }
.ln-trailer-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 18px 14px; border-top: 1px solid var(--ln-line); font-size: 12.5px; color: var(--ln-muted); }
.ln-trailer-foot .ln-link { font-size: 13.5px; }
.ln-trailer.is-played .ln-trailer-foot { background: var(--ln-good-soft); color: var(--ln-good-ink); }

/* Advanced studies: a depth, not a lock. */
.ln-course-depth { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; font-size: 13.5px; color: rgba(255, 255, 255, .85); }
.ln-depth-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: .02em; color: var(--ln-ink-2); background: color-mix(in srgb, var(--ln-ink) 7%, transparent); box-shadow: inset 0 0 0 1px var(--ln-line-2); }
.ln-depth-tag .ln-emblem { width: 13px; height: 13px; stroke-width: 2.2; }
.ln-course-head .ln-depth-tag { color: #fff; background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.ln-course-head .ln-depth-tag .ln-emblem { stroke: #fff; }

/* A lesson started but not finished: its mark half filled. */
.ln-lessons .is-started:not(.is-next) .ln-lesson-mark { box-shadow: inset 0 0 0 2px var(--w-accent); background: linear-gradient(90deg, var(--w-accent) 50%, transparent 50%); }
[dir="rtl"] .ln-lessons .is-started:not(.is-next) .ln-lesson-mark { background: linear-gradient(270deg, var(--w-accent) 50%, transparent 50%); }
/* A locked level: what is inside, above the lock's own words. */

/* Part of: each path as a route strip, this course lit on it. */
.ln-also-route { display: flex; gap: 4px; margin-top: 6px; }
.ln-also-route i { flex: 1; max-width: 26px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .28); }
.ln-also-route i.is-before { background: rgba(255, 255, 255, .55); }
.ln-also-route i.is-here { background: var(--w-glow); box-shadow: 0 0 10px var(--w-glow); }

/* The side: "Watch or do" and "Where this comes from". */
.ln .ln-watch { display: grid; border-radius: 22px; overflow: hidden; background: var(--ln-card); box-shadow: var(--ln-z1); transition: transform .3s var(--ln-ease); }
.ln-watch:hover { transform: translateY(-2px); }
.ln-watch-poster { position: relative; aspect-ratio: 16 / 8; background: var(--w-deep); overflow: hidden; }
.ln-watch-poster img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.ln-watch-play { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .94); box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .6); }
.ln-watch-play svg { width: 18px; height: 18px; fill: var(--w-deep); margin-inline-start: 3px; }
.ln-watch-len { position: absolute; inset-inline-end: 10px; bottom: 10px; padding: 2px 9px; border-radius: 8px; font-size: 12px; font-weight: 750; color: #fff; background: rgba(0, 0, 0, .62); }
.ln-watch-body { display: grid; gap: 4px; padding: 14px 16px 16px; }
.ln-watch-toggle { display: inline-flex; justify-self: start; padding: 3px; margin-bottom: 4px; border-radius: 999px; background: var(--ln-card-2); box-shadow: inset 0 0 0 1px var(--ln-line); font-size: 12px; font-weight: 750; }
.ln-watch-toggle i { font-style: normal; padding: 3px 12px; border-radius: 999px; color: var(--ln-muted); }
.ln-watch-toggle i.is-on { color: #fff; background: var(--ln-ink); }
html[data-theme="dark"] .ln-watch-toggle i.is-on { color: var(--ln-paper); }
.ln-watch-body b { font-family: var(--ln-display); font-weight: 600; font-size: 18px; }
.ln-watch-body > span:not(.ln-watch-toggle) { font-size: 14px; font-weight: 650; color: var(--ln-ink-2); }
.ln-watch-body small { font-size: 12.5px; color: var(--ln-muted); }
.ln-where { padding: 16px 18px; border-radius: 22px; background: var(--ln-card); box-shadow: var(--ln-z1); display: grid; gap: 10px; }
.ln-where .ln-h2 { margin: 0; font-size: 19px; }
.ln-where-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.ln-where-counts p { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--w-accent) 9%, transparent); }
.ln-where-counts b { font-family: var(--ln-display); font-weight: 600; font-size: 26px; line-height: 1; color: var(--w-ink); }
.ln-where-counts span { font-size: 12px; color: var(--ln-ink-2); }
.ln-where-books { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--ln-ink-2); }
.ln-where-names { font-weight: 750; color: var(--ln-ink); }

/* ---------- LD2-F: the path's mastery and what is still needed ---------- */
/* Each station ringed by its mastery: one arc a level, then the final quiz, filled in the world's light. */
.ln-stop-dot .ln-stop-mastery { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); overflow: visible; pointer-events: none; }
.ln-stop-mastery path { fill: none; stroke: rgba(255, 255, 255, .28); stroke-width: 3px; stroke-linecap: round; }
.ln-stop-mastery path.is-on { stroke: var(--w-glow); }
.ln-stop.is-done .ln-stop-mastery { display: none; }
.ln-stop-here { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; color: var(--w-deep); background: var(--w-glow); pointer-events: none; }
[dir="rtl"] .ln-stop-here { left: auto; right: 50%; transform: translateX(50%); }
.ln-stop.is-up .ln-stop-here { bottom: auto; top: calc(100% + 6px); }

.ln-needed { display: grid; gap: 6px; }
.ln-needed-head { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--w-ink); }
.ln-needed ol { display: grid; gap: 2px; }
.ln-needed a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; font-size: 14px; transition: background .2s; }
.ln-needed a:hover { background: color-mix(in srgb, var(--w-accent) 10%, transparent); }
.ln-needed-pips { display: inline-flex; gap: 3px; }
.ln-needed-pips i { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--w-accent); }
.ln-needed-pips i.is-on { background: var(--w-accent); }
.ln-needed-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-needed-state { font-size: 12px; font-weight: 700; color: var(--ln-muted); white-space: nowrap; }

/* The path test page, before the test: what is still needed, and one question to try. */
.ln-main > .ln-ptest { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; margin-top: 22px; align-items: start; }
.ln-ptest h2 { font-family: var(--ln-display); font-weight: 600; font-size: 22px; line-height: 1.2; }
.ln-ptest-q .ln-qbox { margin: 0; }

@media (max-width: 960px) {
  .ln-trailer, [dir="rtl"] .ln-trailer { transform: none; }
  .ln-stop-here, .ln-stop.is-up .ln-stop-here { top: auto; bottom: calc(100% + 6px); }
}
@media (prefers-reduced-motion: reduce) {
  .ln-trailer, [dir="rtl"] .ln-trailer { transform: none; transition: none; }
  .ln-watch { transition: none; }
}
@media (min-width: 961px) {
  /* LD3: the sample screen is as tall as the course's head beside it (never taller), so the levels come up sooner. */
  .ln-cpage > .ln-trailer { align-self: stretch; margin-bottom: 30px; contain: size; min-height: 360px; display: flex; flex-direction: column; }
  .ln-trailer-screen { flex: 1 1 auto; min-height: 0; max-height: none; zoom: .9; }
  .ln-trailer-top, .ln-trailer-foot { flex: none; }
  .ln .ln-watch { grid-template-columns: minmax(170px, 42%) minmax(0, 1fr); }
  .ln-watch-poster { aspect-ratio: auto; min-height: 100%; }
}
