.py-map { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 4px 0 22px; }
.py-unit { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px 12px 10px; border: 1px solid var(--line, #e2e8f0); border-radius: 14px; background: var(--card, #fff); cursor: pointer; transition: border-color .15s, transform .15s; }
.py-unit:hover { border-color: rgb(var(--c-accent-1, 30 74 59)); transform: translateY(-1px); }
.py-unit.is-on { border-color: rgb(var(--c-accent-1, 30 74 59)); box-shadow: 0 0 0 2px rgb(var(--c-accent-1, 30 74 59) / .25); }
.py-unit b { font-size: .95rem; line-height: 1.2; }
.py-unit small { font-size: .75rem; color: #64748b; line-height: 1.3; }
.py-unit-n { position: absolute; top: 8px; right: 10px; font-size: .75rem; font-weight: 700; color: #94a3b8; }
.py-unit-icon { font-size: 1.5rem; }
.py-unit.is-done .py-unit-n::after { content: " ✓"; color: #16a34a; }
.py-bar { display: block; height: 6px; margin-top: auto; border-radius: 99px; background: rgba(148, 163, 184, .25); overflow: hidden; }
.py-bar i { display: block; height: 100%; background: linear-gradient(90deg, rgb(var(--c-accent-1, 30 74 59)), #22c55e); }
.py-count { font-size: .72rem; color: #64748b; }
.py-typed { margin-top: 10px; padding: 10px 12px; border: 1px dashed rgb(var(--c-accent-1, 30 74 59)); border-radius: 12px; background: rgb(var(--c-accent-1, 30 74 59) / .06); }
.py-typed label { display: block; font-size: .85rem; margin-bottom: 6px; }
.py-typed label span { color: #64748b; font-size: .78rem; }
.py-typed textarea { width: 100%; font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 6px 8px; border: 1px solid var(--line, #cbd5e1); border-radius: 8px; background: var(--card, #fff); color: inherit; resize: vertical; }
@media (max-width: 1100px) { .py-map { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .py-map { grid-template-columns: repeat(2, minmax(0, 1fr)); } .py-unit small { display: none; } }
.py-hw { color: #be123c; font-weight: 600; }

/* ---- Step view: one screen per idea, Back / Next, then Try it yourself ---- */
.lk-lesson { position: relative; }
.lk-lesson .is-away { display: none !important; }
.lk-pager { display: flex; flex-direction: column; gap: .5rem; margin: .75rem 0; }
.lk-pager.is-bottom { margin-top: 1rem; }
.lk-pager-bar { height: 6px; border-radius: 999px; background: #e7e5e4; overflow: hidden; }
.lk-pager-bar i { display: block; height: 100%; border-radius: inherit; background: rgb(var(--c-accent-1)); transition: width .4s ease; }
.lk-pager-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.lk-pager-label { font-size: .85rem; font-weight: 600; color: #64748b; text-align: center; }
.lk-pg { animation: lk-in .35s ease-out; }
.lk-intro { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; border-radius: 1rem; background: rgb(var(--c-paper) / .94); animation: lk-fade .25s ease-out; }
.lk-intro-card { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 2rem; text-align: center; }
.lk-intro-icon { font-size: 3.5rem; line-height: 1; animation: lk-pop .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.lk-intro-card p { margin: 0; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: #64748b; }
.lk-intro-card h3 { margin: 0; font-family: "Fraunces", Georgia, serif; font-size: 1.6rem; font-weight: 700; animation: lk-rise .5s .15s both; }
.lk-intro-bar { width: 180px; height: 4px; margin-top: .6rem; border-radius: 999px; background: #e7e5e4; overflow: hidden; }
.lk-intro-bar i { display: block; height: 100%; width: 0; background: rgb(var(--c-accent-1)); animation: lk-fill 1.6s linear forwards; }
.lk-intro-skip { margin-top: .4rem; border: 0; background: none; font-size: .85rem; color: #64748b; text-decoration: underline; cursor: pointer; }
.lk-mistakes details summary { cursor: pointer; font-weight: 600; }
@keyframes lk-fill { to { width: 100%; } }
@keyframes lk-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes lk-rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lk-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lk-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .lk-intro-icon, .lk-intro-card h3, .lk-pg, .lk-intro { animation: none; }
  .lk-intro-bar i { animation: none; width: 100%; }
}

/* Lesson text and answers: no selecting or copying (the student's own code in the editor still works) */
.lk-lesson.is-guarded .lk-explain, .lk-lesson.is-guarded .lk-task, .lk-lesson.is-guarded .lk-quiz,
.lk-lesson.is-guarded .lk-mistakes, .lk-lesson.is-guarded .lk-feedback, .lk-lesson.is-guarded .lk-out,
.lk-lesson.is-guarded .lk-pager, .lk-lesson.is-guarded .lk-intro { -webkit-user-select: none; user-select: none; }

/* Student / teacher view switch (tutors only) */
.lk-viewbar { display: inline-flex; gap: .25rem; margin: 0 0 .75rem; padding: .25rem; border-radius: 999px; background: #f1ebe2; }
.lk-viewbar button { border: 0; border-radius: 999px; padding: .4rem .9rem; background: transparent; font-size: .85rem; font-weight: 600; color: #57534e; cursor: pointer; }
.lk-viewbar button[aria-pressed="true"] { background: #fff; color: #1c1917; box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ---- Step through: watch the code run one line at a time ---- */
.pt { margin: 14px 0; padding: 16px; border-radius: 16px; border: 1px solid #e7e5e4; background: #fff; box-shadow: 0 12px 28px -22px rgba(28,25,23,.5); animation: lk-rise .35s ease both; }
.pt-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.pt-head b { font-size: 16px; color: #0f172a; }
.pt-note { font-size: 13px; color: #64748b; }
.pt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.pt-count { flex: 1; text-align: center; font-size: 13px; font-weight: 700; color: #92400e; }
.pt-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 760px) { .pt-body { grid-template-columns: 1fr; } }
.pt-code { margin: 0; padding: 10px 0; border-radius: 12px; background: #0f172a; color: #e2e8f0; font: 13px/1.6 "JetBrains Mono", ui-monospace, monospace; overflow-x: auto; }
.pt-line { display: block; padding: 0 12px; white-space: pre; transition: background .25s ease; }
.pt-line i { display: inline-block; width: 26px; margin-right: 10px; color: #64748b; font-style: normal; text-align: right; }
.pt-line.is-now { background: rgba(245,158,11,.22); box-shadow: inset 3px 0 0 #f59e0b; color: #fff; }
.pt-side { display: flex; flex-direction: column; gap: 10px; }
.pt-say { margin: 0; padding: 10px 12px; border-radius: 12px; background: #fef3c7; color: #422006; font-size: 15px; line-height: 1.5; animation: lk-in .3s ease both; }
.pt-vars { width: 100%; border-collapse: collapse; font-size: 14px; }
.pt-vars th, .pt-vars td { padding: 6px 8px; border-bottom: 1px solid #f1f5f9; text-align: left; }
.pt-vars th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.pt-vars code { color: #7c2d12; background: none; }
.pt-none { color: #94a3b8; font-style: italic; }
.pt-final { margin: 10px 0 0; font-size: 14px; color: #475569; }
@media (prefers-reduced-motion: reduce) { .pt, .pt-say { animation: none; } .pt-line { transition: none; } }

/* A clear, active roadmap before the course modules. */
.py-path { margin: 18px 0 22px; padding: clamp(18px, 3vw, 30px); border: 1px solid #d8e5df; border-radius: 22px; background: radial-gradient(ellipse at 95% 0%, #dff5ed 0, transparent 42%), linear-gradient(135deg, #fff 0%, #f8fbf9 70%, #f1f7f4 100%); box-shadow: 0 16px 48px -38px rgba(15, 55, 41, .55); }
.py-path-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; }
.py-kicker { color: #168163; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.py-path-head h2 { margin: 4px 0; color: #16382f; font: 700 clamp(1.4rem, 2.7vw, 2rem)/1.16 "Fraunces", Georgia, serif; }
.py-path-head p { margin: 0; color: #5c7269; font-size: 14px; }
.py-path-total { padding: 7px 12px; border: 1px solid #d1e8dd; border-radius: 999px; background: rgba(255,255,255,.72); color: #26745b; font-size: 12px; font-weight: 700; }
.py-path-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.py-path-step { display: flex; min-height: 116px; flex-direction: column; gap: 6px; padding: 11px; border: 1px solid #e2ebe6; border-radius: 14px; background: rgba(255,255,255,.83); transition: transform .2s, border-color .2s, box-shadow .2s; }
.py-path-step > span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 9px; background: #e5f2ec; color: #39715d; font-size: 11px; font-weight: 800; }
.py-path-step b { color: #1d3d33; font-size: 13px; }
.py-path-step small { color: #60736b; font-size: 11px; line-height: 1.45; }
.py-path-step.is-on { transform: translateY(-3px); border-color: #4ba688; background: #f0fbf6; box-shadow: 0 8px 18px -14px #24664f; }
.py-path-step.is-on > span { background: #178163; color: #fff; }
.py-workspace .lk-left { gap: 12px; }
.py-workspace .lk-right { gap: 10px; }
.py-workspace .lk-listfold { order: 0; }
.py-workspace .lk-lesson { display: flex; flex-direction: column; gap: 10px; }
.py-explanation { padding: 13px 15px; border: 1px solid #e2eae6; border-radius: 15px; background: #fff; }
.py-explanation > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; }
.py-explanation > summary::-webkit-details-marker { display: none; }
.py-explanation > summary > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.py-explanation > summary b { color: #244b3d; font-size: 13px; }
.py-explanation > summary small { color: #75867e; font-size: 11px; }
.py-explanation .py-fold-mark { color: #54776a; font-size: 18px; transition: transform .2s; }
.py-explanation:not([open]) .py-fold-mark { transform: rotate(-90deg); }
.py-explanation[open] > .lk-crumb { margin-top: 14px; }
.py-explanation .lk-title { margin: 3px 0 8px; font-size: 1.35rem; }
.py-explanation .lk-explain { max-width: none; margin: 0; font-size: 14px; }
.py-explanation .lk-explain p:last-child { margin-bottom: 0; }
.py-explanation .lk-explain table { min-width: 560px; }
.py-workspace .lk-task { margin: 0; }
.py-workspace .lk-code .lk-editor { min-height: 300px; max-height: 54vh; }
.py-workspace .lk-bar { gap: 6px; }
.py-workspace .lk-right { position: sticky; top: 18px; }
.py-workspace .lk-stagehead { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; border: 1px solid #26364d; border-bottom: 0; border-radius: 15px 15px 0 0; background: #132238; color: #e8f3f0; }
.py-workspace .lk-stagehead::after { content: "LIVE CONSOLE"; color: #8ac9ad; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.py-workspace .lk-stage { min-height: 390px; padding: 18px; border: 1px solid #26364d; border-radius: 0 0 15px 15px; background: #0d1727; color: #e3ecf3; box-shadow: 0 18px 44px -32px rgba(7, 21, 36, .65); }
.py-workspace .lk-stage .lk-empty { color: #9eb1bf; }
.py-workspace .lk-stage .lk-text, .py-workspace .lk-stage .lk-value, .py-workspace .lk-stage .lk-gen { border: 1px solid #27384b; background: #111f31; color: #e7f1f4; font-size: 14px; }
.py-workspace .lk-stage .lk-error { border: 1px solid #6c343b; background: #341e28; color: #ffdce0; }
.py-workspace .lk-feedback { margin-top: 10px; }
.py-workspace .py-typed { border-style: solid; background: #f0f7f3; }
.py-workspace .py-typed textarea { min-height: 70px; }
@media (max-width: 1250px) { .py-path-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .py-workspace.lk-learn.lk-robot { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .py-workspace .lk-right { position: sticky; top: 12px; } }
@media (max-width: 760px) { .py-path-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .py-workspace.lk-learn.lk-robot { grid-template-columns: minmax(0, 1fr); } .py-workspace .lk-right { position: static; } .py-workspace .lk-stage { min-height: 220px; } .py-workspace .lk-code .lk-editor { min-height: 240px; } }
@media (prefers-reduced-motion: reduce) { .py-path-step { transition: none; } }