/* Theory mini-lectures (/courses/<slug>/learn/<n>/). Values come from tokens.css; the page works without JS (everything shown, answers revealed). */
.lec { --c-dir: var(--ds-ink-2); --c-mat: var(--ds-primary); --c-waste: var(--ds-warn); --c-lab: var(--ds-ok); --c-pre: var(--ds-s-purple); --c-ohp: var(--ds-ink);
  --c-prof: var(--ds-s-teal); --c-risk: var(--ds-error); --c-tender: var(--ds-primary); --c-wall: var(--ds-line); --c-open: var(--ds-bg);
  padding-top: var(--sp-5); padding-bottom: var(--sp-8); color: var(--ds-ink); }
.lec img, .lec svg { display: block; max-width: 100%; }
:where(.lec) button { font: inherit; color: inherit; cursor: pointer; }
.lec-eyebrow { font: var(--tag-font); letter-spacing: .04em; text-transform: uppercase; color: var(--ds-ink-3); margin: 0; }
.lec .num { font-variant-numeric: tabular-nums lining-nums; }

.lec-bar { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; pointer-events: none; }
.lec-bar i { display: block; height: 100%; width: 0; background: var(--ds-academy); transition: width var(--dur-m) var(--ease); }

.lec-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: var(--btn-h); padding: 0 var(--sp-5); border-radius: var(--r-full); border: 0;
  background: var(--ds-primary); color: var(--ds-on-primary); font: var(--btn-font); text-decoration: none; transition: background var(--dur-s) var(--ease); }
.lec-btn:hover { background: var(--ds-primary-hover); color: var(--ds-on-primary); }
.lec-btn.tonal { background: var(--ds-primary-tonal); color: var(--ds-primary); }
.lec-btn.tonal:hover { background: var(--ds-primary-tonal-hover); color: var(--ds-primary); }
.lec-btn.text { background: none; color: var(--ds-primary); padding: 0 var(--sp-3); }
.lec-btn.text:hover { background: var(--ds-primary-tonal); }
.lec-btn.s { min-height: var(--btn-h-s); font: var(--btn-font-s); padding: 0 var(--sp-4); }
.lec-btn:disabled { opacity: .48; cursor: default; }

/* head */
.lec-crumb { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; font-size: var(--fs-label); color: var(--ds-ink-3); margin-bottom: var(--sp-5); }
.lec-crumb a { color: inherit; text-decoration: none; }
.lec-crumb a:hover { color: var(--ds-ink); text-decoration: underline; }
.lec-head h1 { font: 600 var(--fs-h1)/var(--lh-tight) var(--ds-font); margin: var(--sp-2) 0 var(--sp-2); max-width: 22ch; }
.lec-task { margin: 0 0 var(--sp-5); color: var(--ds-ink-3); font-size: var(--fs-body-l); }
.lec-obj { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--r-l); padding: var(--sp-5); max-width: 760px; }
.lec-obj h2 { font: 600 var(--fs-body-s)/1.2 var(--ds-font); letter-spacing: .04em; text-transform: uppercase; color: var(--ds-ink-3); margin: 0 0 var(--sp-3); }
.lec-obj ol { margin: 0; padding: 0; list-style: none; counter-reset: o; display: grid; gap: var(--sp-3); }
.lec-obj li { counter-increment: o; display: grid; grid-template-columns: 28px 1fr; gap: var(--sp-3); font-size: var(--fs-body-l); max-width: none; }
.lec-obj li::before { content: counter(o); display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-full); background: var(--ds-academy); color: #fff; font: 600 var(--fs-label)/1 var(--ds-font); }
.lec-pills { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-5); }
.lec-pills a { padding: 6px var(--sp-4); border-radius: var(--r-full); border: 1px solid var(--ds-line-2); font-size: var(--fs-body-s); color: var(--ds-ink-2); text-decoration: none; }
.lec-pills a:hover { background: var(--ds-surface-2); color: var(--ds-ink); }

.lec-blk { margin-top: var(--sp-8); scroll-margin-top: var(--sp-6); }
.lec-bh { margin-bottom: var(--sp-5); }
.lec-bh h2 { font: 600 var(--fs-h2)/var(--lh-tight) var(--ds-font); margin: 0 0 var(--sp-2); }
.lec-lead { color: var(--ds-ink-2); max-width: 62ch; margin: 0; font-size: var(--fs-body-l); }

.lec-note { background: var(--ds-surface); border-inline-start: 3px solid var(--ds-academy); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-s); font-size: var(--fs-body); max-width: none; }
.lec-note b { font-weight: 600; }

/* diagrams: numbers only inside the drawing, words in the legend */
.lec-svg svg { width: 100%; height: auto; font-family: var(--ds-font); }
.lec-svg .f-wall { fill: var(--c-wall); } .lec-svg .f-open { fill: var(--c-open); }
.lec-svg .f-dir { fill: var(--c-dir); } .lec-svg .f-mat, .lec-svg .f-tender { fill: var(--c-mat); } .lec-svg .f-waste { fill: var(--c-waste); }
.lec-svg .f-lab { fill: var(--c-lab); } .lec-svg .f-pre { fill: var(--c-pre); } .lec-svg .f-ohp { fill: var(--c-ohp); }
.lec-svg .f-prof { fill: var(--c-prof); } .lec-svg .f-risk { fill: var(--c-risk); }
.lec-svg .st { stroke: var(--ds-ink); stroke-width: 2; } .lec-svg .st-open { stroke: var(--ds-error); stroke-width: 2; stroke-dasharray: 6 4; }
.lec-svg .hl { stroke: var(--ds-error); stroke-width: 1.4; opacity: .4; }
.lec-svg .dim { stroke: var(--ds-ink-2); stroke-width: 1.5; fill: none; }
.lec-svg .dt { font: 600 16px var(--ds-font); fill: var(--ds-ink); } .lec-svg .dt.sm { font-size: 14px; } .lec-svg .dt.idx { font-weight: 500; fill: var(--ds-ink-3); }
.lec-svg .pill { fill: var(--ds-bg); stroke: var(--ds-line-2); }
.lec-svg .unkbox { fill: none; stroke: var(--ds-line-2); stroke-width: 2; stroke-dasharray: 5 4; }
.lec-svg .link { stroke: var(--ds-line-2); stroke-dasharray: 3 3; } .lec-svg .axis { stroke: var(--ds-line-2); }
.lec-leg { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin: var(--sp-3) 0 0; padding: 0; list-style: none; font-size: var(--fs-label); color: var(--ds-ink-2); }
.lec-leg li { display: inline-flex; align-items: center; gap: 6px; max-width: none; }
.lec-leg b { font-weight: 600; color: var(--ds-ink); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; background: var(--c-dir); }
.f-dir { background: var(--c-dir); } .f-mat, .f-tender { background: var(--c-mat); } .f-waste { background: var(--c-waste); } .f-lab { background: var(--c-lab); }
.f-pre { background: var(--c-pre); } .f-ohp { background: var(--c-ohp); } .f-prof { background: var(--c-prof); } .f-risk { background: var(--c-risk); }
.sw.f-wall { background: var(--c-wall); box-shadow: inset 0 0 0 1.5px var(--ds-ink); }
.sw.f-open { background: repeating-linear-gradient(45deg, var(--c-open) 0 2px, var(--ds-line-2) 2px 3px); box-shadow: inset 0 0 0 1.5px var(--ds-error); }
.hatch { background-image: repeating-linear-gradient(45deg, transparent 0 4px, rgb(255 255 255 / .6) 4px 6px); }
.unk { background: var(--ds-bg); outline: 2px dashed var(--ds-line-2); outline-offset: -2px; color: var(--ds-ink-3); }
.lec-bx { display: flex; height: 44px; border-radius: var(--r-s); overflow: hidden; border: 1px solid var(--ds-line-2); }
.lec-bx i { display: grid; place-items: center; font: 600 var(--fs-label)/1 var(--ds-font); font-style: normal; color: #fff; overflow: hidden; white-space: nowrap; }
.lec-bx i.unk { color: var(--ds-ink-3); }
.lec-leg .num { font-variant-numeric: tabular-nums; }
.lec-calc { border: 1px solid var(--ds-line); border-radius: var(--r-m); background: var(--ds-bg); overflow: hidden; font-size: var(--fs-body); }
.lec-r { display: flex; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-2) var(--sp-4); border-top: 1px solid var(--ds-line); }
.lec-r:first-child { border-top: 0; } .lec-r.tot { background: var(--ds-primary-tonal); font-weight: 600; }
.lec-r span:first-child { color: var(--ds-ink-2); } .lec-r.tot span:first-child { color: var(--ds-ink); }
.lec-r .q { color: var(--ds-ink-3); }
.lec-bars { display: grid; gap: var(--sp-3); }
.brow { display: grid; grid-template-columns: 1fr; gap: 4px; }
.brow .bl { font-size: var(--fs-body-s); color: var(--ds-ink-2); }
.brow .bt { display: flex; height: 28px; background: var(--ds-surface-2); border-radius: var(--r-xs); overflow: hidden; }
.brow .bt i { display: block; height: 100%; }
.brow .bv { font: 600 var(--fs-body-s)/1.2 var(--ds-font); } .brow .bv small { font-weight: 400; color: var(--ds-ink-3); }

/* slides */
.lec-deck { background: var(--ds-bg); border: 1px solid var(--ds-line); border-radius: var(--r-xl); box-shadow: var(--e2); overflow: hidden; touch-action: pan-y; }
.lec-slide { display: grid; grid-template-columns: 5fr 7fr; grid-template-areas: "t v" "c c"; }
.lec-slide.no-m { grid-template-columns: 1fr; grid-template-areas: "t" "c"; }
.lec-st { grid-area: t; padding: var(--sp-7) var(--sp-6); display: flex; flex-direction: column; justify-content: center; gap: var(--sp-3); }
.lec-st h2 { font: 600 var(--fs-headline-s)/var(--lh-tight) var(--ds-font); margin: 0; }
.lec-st ul { margin: 0; padding-inline-start: var(--sp-5); color: var(--ds-ink-2); font-size: var(--fs-body-l); }
.lec-st li { margin: var(--sp-2) 0; }
.lec-sv { grid-area: v; background: var(--ds-surface); border-inline-start: 1px solid var(--ds-line); display: grid; align-content: center; padding: var(--sp-4); min-width: 0; }
.lec-sv img { border-radius: var(--r-m); border: 1px solid var(--ds-line); width: 100%; height: auto; }
.lec-sv .lec-svg, .lec-sv .lec-calc, .lec-sv .lec-stack, .lec-sv .lec-bars { background: var(--ds-bg); border-radius: var(--r-m); padding: var(--sp-4); }
.lec-sv .lec-calc { padding: 0; }
.lec-cap { grid-area: c; display: flex; gap: var(--sp-3); align-items: flex-start; margin: 0; padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--ds-line); color: var(--ds-ink-2); font-size: var(--fs-body); max-width: none; }
.lec-cap i { flex: none; width: 32px; height: 32px; border-radius: var(--r-full); background: var(--ds-primary-tonal); display: grid; place-items: center; }
.lec-cap svg { width: 16px; height: 16px; fill: none; stroke: var(--ds-primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lec-slides .lec-slide + .lec-slide { border-top: 1px solid var(--ds-line); }
.lec-nav { display: none; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-6); border-top: 1px solid var(--ds-line); background: var(--ds-surface); }
.lec-dots { display: flex; gap: var(--sp-2); flex: 1; justify-content: center; }
.lec-dots button { width: 10px; height: 10px; padding: 0; border-radius: var(--r-full); border: 0; background: var(--ds-line-2); transition: transform var(--dur-s) var(--ease), background var(--dur-s); position: relative; }
.lec-dots button::after { content: ""; position: absolute; inset: -9px; }
.lec-dots button[aria-current="true"] { background: var(--ds-primary); transform: scale(1.4); }
.lec-cnt { font-size: var(--fs-label); color: var(--ds-ink-3); min-width: 48px; text-align: end; }
.lec-keys { display: none; text-align: center; font-size: var(--fs-label); color: var(--ds-ink-3); margin: var(--sp-3) 0 0; }
.lec-js .lec-slide { display: none; }
.lec-js .lec-slide.on { display: grid; animation: lec-in var(--dur-l) var(--ease); }
.lec-js .lec-nav { display: flex; } .lec-js .lec-keys { display: block; }
@keyframes lec-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* worked example */
.lec-wgrid { display: grid; grid-template-columns: 7fr 5fr; gap: var(--sp-6); align-items: start; }
.lec-wleft { position: sticky; top: var(--sp-5); }
.lec-board { border: 1px solid var(--ds-line); border-radius: var(--r-l); background: var(--ds-surface); padding: var(--sp-4); }
.lec-board .tag { display: none; justify-content: space-between; font-size: var(--fs-label); color: var(--ds-ink-3); margin-bottom: var(--sp-2); }
.lec-js .lec-board .tag { display: flex; }
.lec-dgb:empty { display: none; }
.lec-dgb .lec-svg, .lec-dgb .lec-bars, .lec-dgb .lec-stack { background: var(--ds-bg); border-radius: var(--r-m); padding: var(--sp-3); }
.lec-dgb .lec-calc { background: var(--ds-bg); }
.lec-facts { margin-top: var(--sp-3); font-size: var(--fs-body-s); color: var(--ds-ink-2); }
.lec-facts b { color: var(--ds-ink); display: block; margin-bottom: var(--sp-1); }
.lec-facts ul { margin: 0; padding-inline-start: var(--sp-4); } .lec-facts li { margin: 2px 0; max-width: none; }
.lec-prog { display: none; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.lec-js .lec-prog { display: flex; }
.lec-prog i { flex: 1; height: 6px; border-radius: var(--r-full); background: var(--ds-line); transition: background var(--dur-m); }
.lec-prog i.d { background: var(--ds-academy); } .lec-prog i.c { background: var(--ds-primary); }
.lec-step { padding-bottom: var(--sp-5); }
.lec-step + .lec-step { border-top: 1px solid var(--ds-line); padding-top: var(--sp-5); }
.lec-step h3, .lec-q h3 { font: 600 var(--fs-title)/1.25 var(--ds-font); margin: var(--sp-2) 0 var(--sp-3); }
.lec-step p { margin: 0 0 var(--sp-3); color: var(--ds-ink-2); max-width: none; }
.lec-step .dg { margin-bottom: var(--sp-4); } .lec-step .dg-ask { display: none; } .lec-js .lec-step .dg { display: none; }
.lec-js .lec-step { display: none; border: 0; padding-top: 0; } .lec-js .lec-step.on { display: block; }
.lec-pred { display: flex; gap: var(--sp-2); align-items: stretch; margin: var(--sp-4) 0 var(--sp-2); }
.lec-pred label { display: flex; flex: 1; align-items: center; gap: var(--sp-2); border: 1px solid var(--ds-line-2); border-radius: var(--r-s); background: var(--ds-bg); padding: 0 var(--sp-3); min-height: var(--btn-h); min-width: 0; }
.lec-pred label:focus-within { border-color: var(--ds-primary); box-shadow: 0 0 0 3px var(--ds-primary-tonal); }
.lec-pred input { flex: 1; min-width: 0; border: 0; outline: 0; font: 500 var(--fs-title-s)/1 var(--ds-font); font-variant-numeric: tabular-nums; padding: 0; background: none; color: var(--ds-ink); }
.lec-pred span { color: var(--ds-ink-3); font-size: var(--fs-body-s); }
.lec-fbk { min-height: 24px; font-size: var(--fs-body-s); margin: var(--sp-2) 0; max-width: none; }
.lec-fbk.bad { color: var(--ds-error); } .lec-fbk.ok { color: var(--ds-ok); font-weight: 600; }
.lec-hint { font-size: var(--fs-body-s); color: var(--ds-ink-2) !important; margin: 0 0 var(--sp-2) !important; }
.lec-js .lec-rev { display: none; margin-top: var(--sp-3); } .lec-js .done > .lec-rev { display: block; }
.lec-js .done .lec-pred, .lec-js .done .lec-show { display: none; }
.lec-js .lec-done { display: none; margin-top: var(--sp-4); } .lec-js .lec-done.on { display: block; }
.lec-js .lec-step.done .lec-fbk:empty { display: none; }

/* explainer */
.lec-sec { display: grid; gap: var(--sp-5); padding: var(--sp-7) 0; border-top: 1px solid var(--ds-line); }
.lec-sec:first-child { border-top: 0; padding-top: 0; }
.lec-sec.has-m { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: var(--sp-7); }
.lec-sec:nth-child(even).has-m .lec-sm { order: -1; }
.lec-sec.is-mistake { background: var(--ds-warn-tonal); border: 1px solid color-mix(in srgb, var(--ds-warn) 25%, transparent); border-radius: var(--r-m); padding: var(--sp-6); margin-top: var(--sp-5); }
.lec-sec.is-mistake + .lec-sec { border-top: 0; }
.lec-mk { color: var(--ds-warn); display: inline-flex; align-items: center; gap: var(--sp-2); }
.lec-mk::before { content: "!"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: var(--r-full); background: var(--ds-warn); color: #fff; font: 700 12px/1 var(--ds-font); }
.lec-src ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.lec-src li { border: 1px solid var(--ds-line); border-radius: var(--r-m); padding: var(--sp-4) var(--sp-5); background: var(--ds-surface); max-width: none; }
.lec-src a { font-weight: 600; color: var(--ds-primary); text-decoration: none; }
.lec-src a:hover { text-decoration: underline; }
.lec-host { display: block; font-size: var(--fs-label); color: var(--ds-ink-3); margin-top: 2px; }
.lec-src p { margin: var(--sp-2) 0 0; color: var(--ds-ink-2); font-size: var(--fs-body-s); max-width: 70ch; }
.lec-sx { max-width: 60ch; }
.lec-sx h2 { font: 600 var(--fs-headline-s)/1.2 var(--ds-font); margin: var(--sp-2) 0 var(--sp-3); }
.lec-sx .idea { font-size: var(--fs-body-l); color: var(--ds-ink-2); margin: 0 0 var(--sp-4); }
.lec-sm img { width: 100%; height: auto; border-radius: var(--r-l); border: 1px solid var(--ds-line); }
.lec-sm .lec-svg, .lec-sm .lec-bars, .lec-sm .lec-stack, .lec-sm .lec-calc { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--r-l); padding: var(--sp-4); }
.lec-sm .lec-calc { padding: 0; background: var(--ds-bg); }
/* a task's own drawing (scene_kit): geometry in its own colours, labels set here */
.lec-scene { margin: 0; background: var(--ds-bg); border: 1px solid var(--ds-line); border-radius: var(--r-l); padding: var(--sp-4); }
.lec-scene svg { display: block; width: 100%; height: auto; direction: ltr; }
.lec-scene .sl { font: 500 var(--fs-label)/1 var(--ds-font); fill: var(--ds-ink); }
.lec-scene .sl.ac { font-weight: 600; fill: var(--ds-primary); }
.lec-scene .sl.ha { paint-order: stroke; stroke: var(--ds-bg); stroke-width: 3px; stroke-linejoin: round; }
.lec-scene figcaption { margin-top: var(--sp-3); font-size: var(--fs-body-s); color: var(--ds-ink-2); }
/* a phone shrinks the labels below reading size: tap shows the figure at full size, swiped sideways (lecture.js) */
.lec-scene.can-zoom { position: relative; cursor: zoom-in; padding-block-end: calc(var(--sp-2) + 28px); }
.lec-scene.can-zoom::after { content: ""; position: absolute; inset-block-end: var(--sp-2); inset-inline-end: var(--sp-2); width: 24px; height: 24px; background: var(--ds-ink-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5M11 8v6M8 11h6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5M11 8v6M8 11h6'/%3E%3C/svg%3E") center / contain no-repeat; }
.lec-scene.can-zoom:focus-visible { outline: 2px solid var(--ds-primary); outline-offset: 2px; }
.lec-sm:has(.is-big) { min-width: 0; }
.lec-scene.is-big { overflow-x: auto; max-width: 100%; cursor: zoom-out; direction: ltr; }
.lec-scene.is-big::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5M8 11h6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5M8 11h6'/%3E%3C/svg%3E"); }
.lec-scene.is-big svg { max-width: none; }
.lec-scene.is-big figcaption { position: sticky; inset-inline-start: 0; }

/* hotspots */
.lec-hsgrid { display: grid; grid-template-columns: 7fr 5fr; gap: var(--sp-5); align-items: start; }
.lec-hsgrid.lec-nopic { grid-template-columns: 1fr; }
.lec-pic { position: relative; border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--ds-line); background: var(--ds-surface); }
.lec-pic > img { width: 100%; height: auto; }
.lec-pt { position: absolute; transform: translate(-50%, -50%); width: 36px; height: 36px; border-radius: var(--r-full); border: 2px solid #fff; background: var(--ds-primary); color: #fff;
  font: 600 var(--fs-body-s)/1 var(--ds-font); display: grid; place-items: center; box-shadow: var(--e2); padding: 0; transition: transform var(--dur-s) var(--ease), background var(--dur-s); }
.lec-pt::before { content: ""; position: absolute; inset: -7px; border-radius: inherit; border: 2px solid var(--ds-primary); opacity: .35; }
.lec-pt::after { content: ""; position: absolute; inset: -9px; }
.lec-pt:hover { transform: translate(-50%, -50%) scale(1.1); }
.lec-pt[aria-pressed="true"] { background: var(--ds-ink); } .lec-pt[aria-pressed="true"]::before { border-color: var(--ds-ink); opacity: .5; }
.lec-pt.seen { background: var(--ds-ok); } .lec-pt.seen[aria-pressed="true"] { background: var(--ds-ink); }
.lec-hl { list-style: none; margin: 0; padding: 0; border: 1px solid var(--ds-line); border-radius: var(--r-l); overflow: hidden; background: var(--ds-bg); }
.lec-hi + .lec-hi { border-top: 1px solid var(--ds-line); }
.lec-hb { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 52px; padding: var(--sp-2) var(--sp-4); background: none; border: 0; text-align: start; font: 600 var(--fs-body-l)/1.3 var(--ds-font); color: var(--ds-ink); }
.lec-hb:hover { background: var(--ds-surface); }
.lec-hb .k { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-full); background: var(--ds-primary); color: #fff; font: 600 var(--fs-label)/1 var(--ds-font); }
.lec-hi.open .lec-hb .k { background: var(--ds-ink); }
.lec-hd { padding: 0 var(--sp-4) var(--sp-4); }
.lec-hd p { margin: 0 0 var(--sp-3); color: var(--ds-ink-2); max-width: none; }
.lec-hd .bl { background: var(--ds-primary-tonal); border-radius: var(--r-s); padding: var(--sp-3) var(--sp-4); font-size: var(--fs-body-s); }
.lec-hd .bl b { display: block; font: var(--tag-font); letter-spacing: .04em; text-transform: uppercase; color: var(--ds-primary); margin-bottom: var(--sp-1); }
.lec-js .lec-hd { display: none; } .lec-js .lec-hi.open .lec-hd { display: block; }
.lec-tap { display: none; } .lec-js .lec-tap { display: inline; }
.lec-seen { margin: var(--sp-3) 0 0; font-size: var(--fs-label); color: var(--ds-ink-3); }

/* check */
.lec-qs { display: grid; gap: var(--sp-4); max-width: 820px; }
.lec-q { border: 1px solid var(--ds-line); border-radius: var(--r-l); padding: var(--sp-5); background: var(--ds-bg); }
.lec-q h3 { font-size: var(--fs-title-s); }
.opts { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.opts li { max-width: none; }
.opt { display: block; width: 100%; text-align: start; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--ds-line-2); border-radius: var(--r-s); background: var(--ds-bg); font-size: var(--fs-body); line-height: 1.4; }
.opt:hover { background: var(--ds-surface); }
.opt.ok, html:not(.lec-js) .opt[data-ok] { border-color: var(--ds-ok); background: var(--ds-ok-tonal); }
.opt.bad { border-color: var(--ds-error); background: var(--ds-error-tonal); }
.of { margin: var(--sp-1) 0 0; padding-inline: var(--sp-4); font-size: var(--fs-body-s); color: var(--ds-ink-2); max-width: none; }
.lec-js .of { display: none; } .lec-js .lec-q.done .of { display: block; }
.lec-js .lec-q.done .opt { pointer-events: none; }
.lec-q .lec-show { margin-top: var(--sp-2); }
.lec-score { margin-top: var(--sp-4); display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.lec-score p { margin: 0; font: 600 var(--fs-title)/1.2 var(--ds-font); }

/* end of lecture */
.lec-cta { margin-top: var(--sp-8); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); flex-wrap: wrap; background: var(--ds-ink); color: #fff; border-radius: var(--r-xl); padding: var(--sp-6); }
.lec-cta h2 { font: 600 var(--fs-headline)/1.2 var(--ds-font); margin: 0 0 var(--sp-2); color: #fff; }
.lec-cta p { margin: 0; color: rgb(255 255 255 / .78); max-width: 52ch; }
.lec-cta .lec-btn { background: #fff; color: var(--ds-ink); }
.lec-cta .lec-btn:hover { background: var(--ds-primary-tonal); color: var(--ds-ink); }
.lec-pnav { display: flex; justify-content: space-between; gap: var(--sp-4); margin-top: var(--sp-5); flex-wrap: wrap; }
.lec-pn { color: var(--ds-ink-2); text-decoration: none; font-size: var(--fs-body); } .lec-pn:hover { color: var(--ds-primary); text-decoration: underline; }
[dir="rtl"] .lec-pn span[aria-hidden], [dir="rtl"] .lec-cta .ar-flip { display: inline-block; transform: scaleX(-1); }

@media (max-width: 860px) {
  .lec-slide { grid-template-columns: 1fr; grid-template-areas: "t" "v" "c"; }
  .lec-st { padding: var(--sp-5) var(--sp-4); }
  .lec-sv { border-inline-start: 0; border-top: 1px solid var(--ds-line); padding: var(--sp-3); }
  .lec-cap { padding: var(--sp-3) var(--sp-4); }
  .lec-nav { padding: var(--sp-3) var(--sp-4); } .lec-keys { display: none !important; }
  .lec-wgrid, .lec-hsgrid, .lec-sec.has-m { grid-template-columns: 1fr; gap: var(--sp-4); }
  .lec-wleft { position: static; order: -1; }
  .lec-sec.has-m .lec-sm { order: 2 !important; }
  .lec-scene { padding: var(--sp-2); }
  .lec-sec.is-mistake:has(.lec-scene) { padding: var(--sp-4); }
  .lec-pt { width: 32px; height: 32px; }
  .lec-q { padding: var(--sp-4); }
  .lec-cta { padding: var(--sp-5); }
  .lec-blk { margin-top: var(--sp-7); }
}
@media (max-width: 480px) { .lec-pred { flex-wrap: wrap; } .lec-pred .lec-btn { flex: 1 1 100%; } }
@media print { .lec-bar, .lec-nav, .lec-pills { display: none; } }
@media (max-width: 480px) { .lec-cnt { display: none; } .lec-nav { gap: var(--sp-2); } }
.lec svg, .lec svg text { direction: ltr; unicode-bidi: isolate; }

/* course opener (/courses/<slug>/learn/): project, people, route, one idea, then task 1 */
.lin .lec-blk { margin-top: var(--sp-8); }
.lin-ic { width: 16px; height: 16px; flex: none; }
.lin-tk { font: 600 var(--fs-label-s)/1 var(--ds-font); font-style: normal; color: var(--ds-primary); background: var(--ds-primary-tonal); border-radius: var(--r-full); padding: 4px 8px; white-space: nowrap; }
.lin-small { font-size: var(--fs-label); color: var(--ds-ink-3); margin: var(--sp-4) 0 0; }
.lin-hex { width: 56px; height: 63px; flex: none; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: var(--ds-line-2); display: grid; place-items: center; }
.lin-hex > * { width: 52px; height: 59px; clip-path: inherit; object-fit: cover; display: grid; place-items: center; background: var(--ds-surface); color: var(--ds-ink-2); }
.lin-hex .lin-ic { width: 22px; height: 22px; }
.lin-hex.me { background: var(--ds-primary); }
.lin-hex.big { width: 96px; height: 108px; } .lin-hex.big > * { width: 90px; height: 102px; }

.lin-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--sp-5) var(--sp-7); align-items: center; }
.lin-hero h1 { font: 600 var(--fs-h1)/var(--lh-tight) var(--ds-font); margin: var(--sp-2) 0 var(--sp-4); }
.lin-lead { font-size: var(--fs-title-s); line-height: var(--lh-body); color: var(--ds-ink-2); margin: 0 0 var(--sp-5); max-width: 46ch; }
.lin-hgo { margin: 0; }
[dir="rtl"] .lin-hgo .ar-flip { display: inline-block; transform: scaleX(-1); }
.lin-key { margin: var(--sp-4) 0 0; font-size: var(--fs-label); color: var(--ds-ink-3); }
.lin-site { position: relative; margin: 0; border-radius: var(--r-l); overflow: hidden; background: var(--cc-photo); aspect-ratio: 1200 / 669; }
.lin-site img { width: 100%; height: 100%; object-fit: cover; }
.lin-site em { position: absolute; inset-inline-end: var(--sp-3); top: var(--sp-3); font: 500 var(--fs-label-s)/1 var(--ds-font); font-style: normal; color: var(--ds-on-scrim); background: var(--ds-scrim); padding: 5px 9px; border-radius: var(--r-full); }
.lin-site figcaption { position: absolute; inset: auto 0 0 0; padding: var(--sp-6) var(--sp-4) var(--sp-3); color: var(--ds-on-scrim); background: linear-gradient(to top, var(--cc-scrim), var(--cc-scrim-0)); font-size: var(--fs-label); }
.lin-site figcaption b { display: block; font-size: var(--fs-body-l); font-weight: 600; }
.lin-hero.no-site { grid-template-columns: minmax(0, 1fr); }
.lin-hero.no-site .lin-lead { max-width: 60ch; }
.lin-proj { margin: 0 0 var(--sp-4); font-size: var(--fs-body); color: var(--ds-ink-2); }
.lin-proj b { color: var(--ds-ink); font-weight: 600; }
.lin-proj em { font-style: normal; font-size: var(--fs-label-s); color: var(--ds-ink-3); }
.lin-facts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); margin: var(--sp-2) 0 0; padding-top: var(--sp-4); border-top: 1px solid var(--ds-line); }
.lin-facts dt { font: var(--tag-font); letter-spacing: .04em; text-transform: uppercase; color: var(--ds-ink-3); margin-bottom: 4px; }
.lin-facts dd { margin: 0; font-size: var(--fs-body); color: var(--ds-ink); }

/* who hands what to whom */
.lin-flow { display: grid; grid-template-columns: minmax(0, 1fr) 176px minmax(0, 1fr); gap: var(--sp-4); align-items: center; }
.lin-side h3 { font: var(--tag-font); letter-spacing: .04em; text-transform: uppercase; color: var(--ds-ink-3); margin: 0 0 var(--sp-3); }
.lin-side.out h3 { text-align: end; }
.lin-col { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.lin-p { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: var(--sp-3); max-width: none; }
.out .lin-p { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.lin-who { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.out .lin-who { flex-direction: row-reverse; text-align: end; }
.lin-who b { display: block; font-size: var(--fs-body); font-weight: 600; line-height: 1.25; }
.lin-who small { display: block; font-size: var(--fs-label); color: var(--ds-ink-3); line-height: 1.3; }
.lin-arw { display: grid; gap: 6px; }
.lin-arw i { display: block; height: 2px; background: var(--ds-primary); position: relative; }
.lin-arw i::after { content: ""; position: absolute; inset-inline-end: -1px; top: -4px; border-inline-start: 8px solid var(--ds-primary); border-block: 5px solid transparent; }
.lin-pass { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px var(--sp-2); justify-content: center; }
.lin-pass li { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-body-s); font-weight: 500; color: var(--ds-ink); max-width: none; }
.lin-you { display: grid; justify-items: center; text-align: center; gap: 4px; padding: var(--sp-5) var(--sp-3); background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--r-l); }
.lin-you b { font-size: var(--fs-title-s); font-weight: 600; margin-top: var(--sp-2); }
.lin-you small { font-size: var(--fs-label); color: var(--ds-ink-2); line-height: 1.35; }

/* the route */
.lin-route { display: grid; gap: var(--sp-3); }
.lin-bands { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: var(--sp-3); }
.lin-bands span { font: var(--tag-font); letter-spacing: .04em; text-transform: uppercase; color: var(--ds-ink-2); padding: 0 0 var(--sp-2); border-bottom: 2px solid var(--ds-ink); }
.lin-route ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: var(--sp-3); position: relative; }
.lin-route ol::before { content: ""; position: absolute; inset-inline: 16px; top: 16px; height: 2px; background: var(--ds-line-2); }
.lin-st { position: relative; display: flex; flex-direction: column; max-width: none; }
.lin-dot { position: relative; width: 32px; height: 32px; border-radius: var(--r-full); display: grid; place-items: center; background: var(--ds-bg); border: 2px solid var(--ds-line-2); font: 600 var(--fs-body-s)/1 var(--ds-font); color: var(--ds-ink-2); margin-bottom: var(--sp-3); }
.lin-st.is-first .lin-dot { background: var(--ds-primary); border-color: var(--ds-primary); color: var(--ds-on-primary); }
.lin-ph { display: none; }
.lin-min { margin: 0; font-size: var(--fs-label); color: var(--ds-ink-3); }
.lin-st h3 { font: 600 var(--fs-title-s)/1.25 var(--ds-font); margin: 4px 0 var(--sp-3); min-height: 2.5em; }
.lin-st dl { margin: 0; display: grid; align-content: start; gap: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--ds-line); flex: 1; }
.lin-st dt { display: flex; align-items: center; gap: 6px; font-size: var(--fs-label); color: var(--ds-ink-3); margin-bottom: 2px; }
.lin-st dd { margin: 0; font-size: var(--fs-body-s); line-height: 1.4; color: var(--ds-ink-2); }
.lin-st .pr dd { font-size: var(--fs-body); font-weight: 600; color: var(--ds-ink); }
.lin-st.is-first .pr dt { color: var(--ds-primary); }

/* the idea: where the money goes, task by task */
.lin-idea { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: var(--sp-6); }
.lin-stage { margin: 0; position: relative; display: grid; grid-template-rows: auto 1fr; gap: var(--sp-3); }
.lin-stage + .lin-stage::before { content: ""; position: absolute; inset-inline-start: calc(-1 * var(--sp-6) + 6px); top: 120px; width: calc(var(--sp-6) - 12px); height: 2px; background: var(--ds-line-2); }
.lin-stage + .lin-stage::after { content: ""; position: absolute; inset-inline-start: -10px; top: 116px; border-inline-start: 7px solid var(--ds-line-2); border-block: 5px solid transparent; }
.lin-bar { height: 240px; display: flex; flex-direction: column; gap: 2px; }
.lin-bar i { display: flex; align-items: center; min-height: 26px; padding: 4px 10px; border-radius: var(--r-xs); font: 500 var(--fs-label)/1.2 var(--ds-font); font-style: normal; background: var(--ds-line); color: var(--ds-ink-2); overflow: hidden; }
.lin-bar i.k-gap { background: none; min-height: 0; padding: 0; }
.lin-bar i.new { background: var(--ds-primary); color: var(--ds-on-primary); }
.lin-bar i.new.k-ohp { background: var(--ds-primary-hover); }
.lin-bar i.k-sum { background: var(--ds-line); color: var(--ds-ink-2); }
.lin-bar i.k-ret { background: repeating-linear-gradient(45deg, var(--ds-primary-tonal) 0 6px, var(--ds-primary-tonal-hover) 6px 12px); color: var(--ds-primary); }
.lin-bar i.k-todo { background: var(--ds-bg); border: 2px dashed var(--ds-line-2); color: var(--ds-ink-3); }
.lin-stage figcaption { display: grid; gap: 4px; justify-items: start; align-content: start; }
.lin-stage figcaption b { font-size: var(--fs-body-l); font-weight: 600; margin-top: 4px; }
.lin-stage figcaption span { font-size: var(--fs-body-s); color: var(--ds-ink-2); line-height: 1.45; }
.lin-rule { margin-top: var(--sp-5); font-size: var(--fs-body-l); }

.lin-cta .lin-ck { font: var(--tag-font); letter-spacing: .04em; text-transform: uppercase; color: rgb(255 255 255 / .7); margin: 0 0 var(--sp-2); }
.lin-cta .lin-cm { font-weight: 400; color: rgb(255 255 255 / .7); }
.lin-go { display: grid; gap: var(--sp-3); justify-items: center; }
.lin-th { color: #fff; font-size: var(--fs-body-s); text-decoration: underline; text-underline-offset: 3px; }
.lin-th:hover { color: var(--ds-primary-tonal); }
.lec-intro { margin: calc(-1 * var(--sp-3)) 0 var(--sp-5); font-size: var(--fs-body-s); }
.lec-intro a { color: var(--ds-primary); text-decoration: none; } .lec-intro a:hover { text-decoration: underline; }
.lec-ask { display: flex; gap: var(--sp-3); align-items: flex-start; max-width: 760px; margin: 0 0 var(--sp-5); padding: var(--sp-3) var(--sp-4);
  background: var(--ds-surface); border: 1px solid var(--ds-line); border-inline-start: 3px solid var(--ds-primary); border-radius: var(--r-m); }
.lec-ask .lin-ic { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--ds-primary); }
.lec-ask p { margin: 0; font-size: var(--fs-body-s); line-height: var(--lh-body); color: var(--ds-ink-2); }
.lec-ask strong { color: var(--ds-ink); font-weight: 600; }
.lec-ask a { color: var(--ds-primary); font-weight: 600; overflow-wrap: anywhere; }
[dir="rtl"] .lec-intro span[aria-hidden] { display: inline-block; transform: scaleX(-1); }

@media (max-width: 960px) {
  .lin-hero { grid-template-columns: 1fr; gap: var(--sp-5); }
  .lin-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lin-flow { grid-template-columns: 1fr; }
  .lin-you { grid-template-columns: auto 1fr; justify-items: start; text-align: start; align-items: center; column-gap: var(--sp-4); padding: var(--sp-4); }
  .lin-you .lin-hex { grid-row: span 2; width: 64px; height: 72px; } .lin-you .lin-hex > * { width: 60px; height: 68px; }
  .lin-you b { margin: 0; align-self: end; }
  .lin-you small { align-self: start; }
  .lin-side.out h3 { text-align: start; }
  .lin-bands { display: none; }
  .lin-route ol { grid-template-columns: 1fr; gap: 0; }
  .lin-route ol::before { inset-inline: auto; inset-inline-start: 15px; top: 16px; bottom: 16px; width: 2px; height: auto; }
  .lin-st { display: grid; grid-template-columns: 32px 1fr; column-gap: var(--sp-4); padding-bottom: var(--sp-5); }
  .lin-st > :not(.lin-dot) { grid-column: 2; }
  .lin-dot { grid-row: 1 / span 4; margin: 0; }
  .lin-ph { display: block; margin: 0; font: var(--tag-font); letter-spacing: .04em; text-transform: uppercase; color: var(--ds-ink-2); }
  .lin-st h3 { min-height: 0; }
  .lin-st dl { gap: var(--sp-2); }
  .lin-st dl > div { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: var(--sp-2); align-items: baseline; }
  .lin-st dt { margin: 0; }
  .lin-idea { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-6) var(--sp-4); }
  .lin-stage + .lin-stage::before, .lin-stage + .lin-stage::after { display: none; }
  .lin-bar { height: 200px; }
  .lin-go { justify-items: start; }
}
@media (max-width: 480px) {
  /* One column: a long German name and its documents no longer share a 390 px row. */
  .lin-p, .out .lin-p { grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
  .lin-who b, .lin-pass li { overflow-wrap: anywhere; }
  .lin-pass { justify-content: flex-start; }
  .lin-hex { width: 48px; height: 54px; } .lin-hex > * { width: 44px; height: 50px; }
  .lin-lead { font-size: var(--fs-body-l); }
}
