:root{color-scheme:light;--ink:#202325;--muted:#656c70;--line:#dee1df;--surface:#fff;--washed:#f6f7f5;--deep:#121718;--accent:#15675c;--active:#e9f4f0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:15px}*{box-sizing:border-box}body{margin:0;color:var(--ink);background:#fdfdfb;line-height:1.6}button,textarea,input{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.4}a{color:inherit}a:hover{color:var(--accent)}:focus-visible{outline:3px solid #63a99b;outline-offset:2px}.skip{position:absolute;top:-100px;left:8px;background:#fff;padding:8px;z-index:10}.skip:focus{top:8px}.topbar{height:74px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);padding:0 clamp(18px,3vw,46px);background:var(--surface)}.brand{display:flex;align-items:center;gap:14px;text-decoration:none;line-height:1.2}.brand-mark{display:grid;place-items:center;font-family:Georgia,serif;font-size:35px;font-weight:700;color:#fff;background:#232b29;width:43px;height:43px}.brand-mark span{color:#8bc2a7}.brand strong{font-size:17px;letter-spacing:-.03em;display:block}.brand small{font-size:11px;color:var(--muted);display:block;margin-top:4px}.top-right{display:flex;align-items:center;gap:22px}.course{font-size:12px;color:var(--muted)}.quiet{border:0;background:none;padding:8px 0;color:var(--accent);text-decoration:underline;text-underline-offset:3px;font-weight:600}.shell{display:grid;grid-template-columns:242px minmax(420px,1fr) 355px;align-items:start;max-width:1660px;margin:0 auto;min-height:calc(100vh - 74px)}.sidebar{border-right:1px solid var(--line);height:calc(100vh - 74px);position:sticky;top:0;overflow:auto;padding:28px 0 30px}.sidebar-head{padding:0 22px 20px}.eyebrow{font-size:10px;font-weight:800;letter-spacing:.12em;color:var(--accent)}.sidebar h2,.compiler h2{margin:8px 0 15px;font-size:17px;letter-spacing:-.03em}.progress-bar{height:5px;background:#e4e8e5;width:100%}.progress-bar span{display:block;height:100%;background:var(--accent);width:0;transition:width .2s}.sidebar-head p{font-size:12px;color:var(--muted);margin:10px 0 0}.nav-group{padding-bottom:19px}.nav-group h3{margin:0 0 7px;padding:14px 22px 6px;font-size:10px;letter-spacing:.09em;color:#7b817f;text-transform:uppercase}.lesson-link{display:flex;text-decoration:none;align-items:center;gap:10px;padding:10px 20px;font-size:12px;line-height:1.35;border-left:3px solid transparent}.lesson-link:hover{background:var(--washed);color:var(--ink)}.lesson-link.active{background:var(--active);border-left-color:var(--accent);font-weight:700}.lesson-number{color:var(--muted);font-variant-numeric:tabular-nums;width:22px}.lesson-link-name{flex:1}.nav-score{font-variant-numeric:tabular-nums;color:var(--accent);font-size:11px}.sidebar-foot{font-size:11px;color:var(--muted);border-top:1px solid var(--line);margin:6px 22px;padding-top:16px}main{padding:47px clamp(24px,4vw,70px) 90px;min-width:0;max-width:925px;width:100%;margin:auto}.lesson-meta{display:flex;flex-wrap:wrap;gap:18px;color:var(--muted);font-size:11px;letter-spacing:.04em}.lesson-meta .eyebrow{color:var(--accent)}h1{font-size:clamp(33px,3vw,48px);line-height:1.12;letter-spacing:-.055em;font-weight:670;margin:17px 0 13px}.lead{font-size:16px;color:#555f60;margin:0 0 38px;max-width:640px}.paper{margin:0 0 40px}.section-title{display:flex;align-items:baseline;gap:13px;border-bottom:1px solid var(--line);padding-bottom:10px;margin-bottom:18px}.section-title h2{font-size:20px;margin:0;letter-spacing:-.028em}.section-num{font-size:11px;color:var(--accent);font-weight:700;font-variant-numeric:tabular-nums}.paper p{font-size:14px}.code-label{display:flex;justify-content:space-between;font-size:10px;letter-spacing:.1em;font-weight:800;color:#64706c;margin-top:20px;margin-bottom:0}.code{background:#1b2425;color:#e2ebea;margin:6px 0 16px;padding:18px 20px;font-size:13px;line-height:1.7;font-family:"Cascadia Code","JetBrains Mono",Consolas,monospace;overflow:auto;white-space:pre}.code code{font-family:inherit}.section-intro{font-size:12px!important;color:var(--muted)}.question{padding:18px 0 23px;border-bottom:1px solid var(--line)}.question-head{display:flex;justify-content:space-between;font-size:10px;font-weight:800;letter-spacing:.075em;color:var(--muted)}.question h3{font-size:15px;letter-spacing:-.015em;font-weight:650;margin:10px 0}.choices{display:grid;grid-template-columns:1fr 1fr;gap:7px}.choice{min-height:48px;text-align:left;border:1px solid var(--line);background:var(--surface);display:flex;align-items:center;gap:11px;padding:9px 12px;color:var(--ink);font-size:13px;line-height:1.4}.choice>span{font-size:10px;color:var(--muted);font-weight:700;border:1px solid var(--line);min-width:20px;height:20px;display:grid;place-items:center}.choice:hover{border-color:var(--accent)}.choice.selected{background:#eaf4f1;border-color:var(--accent)}.choice.selected>span{color:#fff;background:var(--accent);border-color:var(--accent)}.correct{color:#146e50}.retry{color:#996b30}.question-hint{margin-top:9px}.question-hint summary,details summary{cursor:pointer;color:#52615d;font-size:12px;font-weight:600}.question-hint p,details p{font-size:12px;color:var(--muted)}details:not(.question-hint){border-bottom:1px solid var(--line);padding:10px 2px}.text-button{border:0;background:none;color:var(--accent);font-size:12px;letter-spacing:0;text-decoration:underline;cursor:pointer}.lesson-footer{display:flex;justify-content:space-between;gap:10px;margin-top:45px}.primary,.secondary{border:1px solid var(--deep);padding:11px 16px;border-radius:2px;font-size:13px;font-weight:700;min-height:42px}.primary{color:#fff;background:var(--deep)}.primary:hover{background:#35514a}.secondary{color:var(--ink);background:var(--surface);border-color:#b4beb9}.secondary:hover{background:var(--washed)}.compiler{border-left:1px solid var(--line);padding:30px 21px;position:sticky;top:0;max-height:calc(100vh - 74px);overflow-y:auto;background:#fafbf9}.compiler-heading{display:flex;align-items:start;justify-content:space-between;gap:10px}.compiler h2{margin:4px 0 9px}.runtime-tag{font-size:10px;color:#586660;border:1px solid #d6dfd9;padding:4px 6px;text-align:center;flex-shrink:0}.compiler-explainer,.result-panel p,.settings-panel p,.privacy-note{font-size:12px;color:var(--muted);line-height:1.6}.placeholder{padding:46px 20px;text-align:center;border:1px dashed #bec9c3;background:#f3f5f2}.placeholder-icon{font-family:monospace;font-size:34px;display:block;color:#a0b3ab;margin-bottom:12px}.placeholder strong{display:block;font-size:13px}.placeholder p{font-size:12px;color:var(--muted);margin:9px 0 0}.jdoodle-embed{min-height:330px}.compiler-links{display:flex;gap:10px;justify-content:space-between;margin:13px 0 30px;flex-wrap:wrap}.compiler-links a,.settings-panel a{font-size:12px;color:var(--accent);font-weight:650}.result-panel,.settings-panel{border-top:1px solid var(--line);padding-top:16px;margin-top:18px}.result-panel h3,.settings-panel h3{margin:0 0 8px;font-size:14px}.result-panel label,.settings-panel label{display:block;margin-bottom:7px;font-size:11px;font-weight:700}.result-panel textarea,.settings-panel input{resize:vertical;width:100%;border:1px solid #cbd4cf;border-radius:2px;padding:10px;background:#fff;color:var(--ink);font-family:"Cascadia Code",monospace;font-size:12px}.settings-panel input{font-family:inherit}.full{width:100%;margin-top:10px}.feedback{font-size:12px;min-height:17px;color:var(--accent)}.feedback[data-status="differs"]{color:#a05b31}.feedback[data-status="missing"]{color:#985c24}.settings-panel[hidden]{display:none}.privacy-note{border-top:1px solid var(--line);padding-top:16px;margin-top:25px}.error{color:#a34539;font-size:12px}
@media(max-width:1250px){.shell{grid-template-columns:205px minmax(300px,1fr)}.compiler{position:relative;grid-column:2;border-top:1px solid var(--line);border-left:0;max-height:none}.sidebar{grid-row:1 / span 2}.course{display:none}}
@media(max-width:760px){.topbar{padding:0 18px;height:64px}.brand small{font-size:9px;max-width:165px}.top-right{gap:0}.shell{display:block}.sidebar{position:relative;height:auto;max-height:245px;border:0;border-bottom:1px solid var(--line);padding:15px 0 5px}.sidebar-head{padding:0 20px 10px}.sidebar-head h2{margin:3px 0 9px}.nav-group{padding-bottom:6px}.nav-group h3{padding:4px 20px}.nav-group{display:flex;overflow-x:auto;align-items:center}.nav-group h3{min-width:115px}.lesson-link{white-space:nowrap;min-width:170px;padding:9px;border-left:0;border-bottom:2px solid transparent}.lesson-link.active{border-left:0;border-bottom-color:var(--accent)}.sidebar-foot{display:none}main{padding:30px 20px 40px}.lead{margin-bottom:23px}.compiler{padding:25px 20px}.choices{grid-template-columns:1fr}.lesson-footer{margin-top:30px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
@media(prefers-color-scheme:dark){:root{color-scheme:dark;--ink:#edf2ee;--muted:#a5ada8;--line:#35403c;--surface:#171d1b;--washed:#1f2824;--deep:#24332e;--accent:#90c5b5;--active:#1f352e}body{background:#131917}.topbar,.compiler{background:#171d1b}.brand-mark{background:#d5ebe1;color:#17241e}.placeholder{background:#1b2521;border-color:#485b51}.code{background:#0b1110}.choice.selected{background:#27483c}.choice.selected>span{color:#162b22;background:#a2d7c4}.correct{color:#a1d8bb}.retry{color:#e4ba7a}.lead{color:#c2cac6}.section-intro,.compiler-explainer{color:#a5ada8}.primary{background:#b3dec9;border-color:#b3dec9;color:#11201b}.primary:hover{background:#d5f0e3}.secondary{background:#1d2522;color:#edf2ee;border-color:#55645c}.secondary:hover{background:#29352f}.result-panel textarea,.settings-panel input{background:#111916;color:#edf2ee;border-color:#57655c}.feedback[data-status="differs"],.error{color:#d59e85}.sidebar-head .progress-bar{background:#304139}.runtime-tag{border-color:#485b51;color:#bac9c0}}

/* Lesson-scoped editable Julia drafts; editor is local and never executes code. */
.draft-title{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-top:19px}
.draft-title label{font-size:11px;letter-spacing:.06em;font-weight:800}
.draft-caption{font-size:11px;color:var(--muted)}
.scratch-editor{display:block;width:100%;min-height:174px;resize:vertical;padding:14px;border:1px solid #abb8b2;background:var(--surface);color:var(--ink);border-radius:2px;font:13px/1.65 "Cascadia Code","JetBrains Mono",Consolas,monospace;tab-size:4;white-space:pre}
.draft-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px}
.draft-actions .quiet{min-height:42px;padding:10px}
@media(max-width:400px){.draft-title{display:block}.draft-caption{display:block;margin-top:2px}.draft-actions{flex-wrap:wrap}}

.bridge-diagnostics{margin-top:20px;border-top:1px solid var(--line);padding-top:16px}
.bridge-diagnostics>summary{font-size:13px;font-weight:700;color:var(--ink);cursor:pointer}
.bridge-diagnostics p{font-size:12px;color:var(--muted)}
.bridge-diagnostics #bridge-status{overflow-wrap:anywhere}

/* Local .jl exchange and reachable mobile compiler fallback */
.draft-actions{flex-wrap:wrap;justify-content:flex-start;gap:8px}
.draft-actions .secondary{padding:10px 12px}
.draft-actions .quiet{margin-left:auto}
.jump-to-compiler{margin-top:10px;max-width:100%}
.fallback-help{padding:12px 13px;margin:12px 0 20px;border:1px solid var(--line);font-size:12px;line-height:1.65;color:var(--muted)}
.fallback-help strong{display:block;color:var(--ink);font-size:13px;margin-bottom:4px}
.fallback-help button{display:block;margin-top:6px}
@media(max-width:760px){.jump-to-compiler{width:100%}.draft-actions .quiet{margin-left:0}.compiler{scroll-margin-top:8px}}

/* J8: actionable learning continuation and source-authored concept feedback */
.continue-button{display:block;width:100%;margin-top:15px;padding:10px 12px;border:1px solid var(--accent);background:var(--surface);color:var(--ink);text-align:left;line-height:1.4;font-size:14px;font-weight:650;border-radius:2px}
.continue-button:hover{background:var(--active)}
.continue-detail{font-size:14px!important;line-height:1.45;color:var(--muted)}
.answer-reason{border-left:3px solid var(--accent);padding:8px 12px;margin:12px 0 8px;font-size:14px!important;line-height:1.55;background:var(--washed)}
.answer-reason.wrong{border-left-color:#b98b5f}
.concept-brief{margin-top:14px;font-size:14px!important;font-weight:600;color:var(--ink)}
#lesson-title:focus{outline-offset:5px}
@media(max-width:760px){.continue-button{margin-top:8px}.continue-detail{margin-top:6px!important}}

/* J9: standalone repair exercise, distinct from the graded concept questions */
.repair-lab h3{font-size:17px;font-weight:650;line-height:1.4;margin:0 0 8px}
.repair-lab>label{display:block;margin:18px 0 8px;font-size:14px;font-weight:650}
.repair-target{font-size:14px!important;color:var(--ink);margin:12px 0}
.repair-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px;align-items:center}
.repair-actions .quiet{margin-left:auto}
.repair-feedback{font-size:14px!important;line-height:1.5;margin-top:10px;color:var(--muted)}
.repair-feedback[data-status="match"]{color:var(--accent)}
.repair-feedback[data-status="error"]{color:#b26f43}
.repair-lab #repair-reference pre{margin-top:12px}
.repair-lab #repair-cause{font-size:14px;color:var(--ink)}
@media(max-width:760px){.repair-actions .quiet{margin-left:0}}

/* J10 numerical explorer: meaningful mathematical data, independent of external runtimes. */
.numerical-explorer[hidden]{display:none}
.numerical-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:0 0 16px}
.numerical-controls label{display:flex;flex-direction:column;gap:6px;font-size:14px;font-weight:650}
.numerical-controls select,.numerical-controls input{width:100%;min-width:0}
.numerical-controls select{background:var(--surface);color:var(--ink);border:1px solid var(--line);padding:9px;font-size:14px}
.numerical-controls input{accent-color:var(--accent)}
.numerical-layout{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:20px;align-items:start}
#numerical-plot{display:block;width:100%;height:auto;aspect-ratio:1;border:1px solid var(--line);background:var(--surface)}
#numerical-plot .gridline{stroke:var(--line);stroke-width:.017}
#numerical-plot .axis{stroke:var(--muted);stroke-width:.06}
#numerical-plot .numeric-reference{stroke:var(--ink);fill:none;stroke-width:.085}
#numerical-plot .numeric-direct{stroke:#c77b46;fill:none;stroke-width:.085;stroke-dasharray:.2 .12}
#numerical-plot .numeric-inverse{stroke:#478ab1;fill:none;stroke-width:.085;stroke-dasharray:.13 .1}
#numerical-plot .numeric-vector-input-line{stroke:#b266b7;stroke-width:.09}
#numerical-plot .numeric-vector-output-line{stroke:#298c62;stroke-width:.09}
#numerical-plot .numeric-vector-input{fill:#b266b7}
#numerical-plot .numeric-vector-output{fill:#298c62}
.numerical-legend{display:flex;flex-wrap:wrap;gap:8px 14px;font-size:13px}
.numerical-legend>span{display:flex;align-items:center;gap:6px}
.numerical-legend i{width:14px;height:4px;display:inline-block;background:var(--ink)}
.numerical-legend .numeric-legend-input{background:#b266b7}
.numerical-legend .numeric-legend-output{background:#298c62}
.numerical-legend .numeric-legend-direct{background:#c77b46}
.numerical-legend .numeric-legend-inverse{background:#478ab1}
.numerical-values{font-size:14px;margin:16px 0}
.numerical-values>div{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-bottom:1px solid var(--line)}
.numerical-values dt{font-weight:650}
.numerical-values dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}
.numerical-state,.numerical-note{font-size:14px!important;line-height:1.55}
.numerical-note{color:var(--muted);margin-top:15px}
@media(max-width:850px){.numerical-layout{grid-template-columns:1fr}.numerical-controls{grid-template-columns:1fr 1fr}}
@media(max-width:420px){.numerical-controls{grid-template-columns:1fr} }

/* Elimination stepper: visible row operations, matrix data, no coding grade. */
.elimination-lab[hidden]{display:none}
.elim-controls{display:grid;grid-template-columns:auto minmax(140px,1fr);gap:10px 14px;align-items:center;margin-bottom:18px}
.elim-controls label{font-size:14px;font-weight:650}
.elim-controls select{padding:9px;min-width:0;font-size:14px;color:var(--ink);border:1px solid var(--line);background:var(--surface)}
.elim-step{font-size:14px!important;font-weight:700;color:var(--accent);margin:0 0 4px}
.elim-operation{font-size:15px!important;min-height:2.7em;margin:0 0 10px}
.elim-matrix-scroll{max-width:100%;overflow-x:auto;border:1px solid var(--line)}
.elim-matrix{border-collapse:collapse;width:100%;min-width:320px;font:14px/1.5 "Cascadia Code",Consolas,monospace;font-variant-numeric:tabular-nums}
.elim-matrix th,.elim-matrix td{text-align:right;padding:10px 8px;border-bottom:1px solid var(--line)}
.elim-matrix th:first-child{text-align:left;color:var(--muted);font-size:13px}
.elim-matrix thead th{font-size:13px;color:var(--muted);font-weight:700;background:var(--washed)}
.elim-matrix tbody tr:last-child>*{border-bottom:0}
.elim-matrix .elim-active-row>*{background:var(--active)}
.elim-matrix td.elim-rhs{border-left:2px solid var(--muted);font-weight:700}
.elim-matrix td.elim-pivot-column{text-decoration:underline;text-underline-offset:3px}
.elim-step-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:13px}
.elim-step-actions button{flex:1;min-width:90px}
.elim-result{padding:12px 14px;border-left:3px solid var(--accent);background:var(--washed);margin-top:14px}
.elim-result[hidden]{display:none}
.elim-result p{font-size:14px!important;margin:0 0 6px}
.elim-result p:last-child{margin-bottom:0}
.elim-julia-details{margin-top:18px}
.elim-julia-details pre{margin-top:12px}
.elim-disclaimer{font-size:14px!important;color:var(--muted);margin-top:16px}
@media(max-width:500px){.elim-controls{grid-template-columns:1fr;gap:6px}.elim-step-actions button{min-width:calc(50% - 6px)}}

/* J12: data-based numerical error exploration, no decorative microcopy. */
.precision-lab[hidden]{display:none}
.precision-controls{display:grid;grid-template-columns:minmax(150px,auto) minmax(120px,1fr);align-items:center;gap:10px 18px;margin-bottom:15px}
.precision-controls label{font-size:14px;font-weight:650}
.precision-controls select{min-width:0;background:var(--surface);color:var(--ink);padding:10px;border:1px solid var(--line);font-size:14px}
.precision-controls input{width:100%;min-width:0;accent-color:var(--accent)}
.precision-formula{font-size:15px!important;line-height:1.5;margin:8px 0}
#precision-chart{display:block;width:100%;height:auto;border:1px solid var(--line);background:var(--surface);margin:14px 0 10px}
.precision-grid{stroke:var(--line);stroke-width:1}
.precision-tick{font:12px system-ui,sans-serif;fill:var(--muted)}
.precision-selection{stroke:var(--ink);stroke-width:1;stroke-dasharray:3 4;opacity:.7}
.precision-line{stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.precision-point{stroke:var(--surface);stroke-width:1}
.precision-forward{stroke:#b7733a;fill:#b7733a}
.precision-central{stroke:#298c62;fill:#298c62}
.precision-stabilized{stroke:#6b7ec1;fill:#6b7ec1}
.precision-line.precision-forward,.precision-line.precision-central,.precision-line.precision-stabilized{fill:none}
.precision-legend{display:flex;flex-wrap:wrap;gap:8px 18px;font-size:14px}
.precision-legend span{display:inline-flex;align-items:center;gap:8px}
.precision-legend span:before{content:"";display:inline-block;width:16px;height:3px;background:currentColor}
.precision-legend-forward{color:#b7733a}
.precision-legend-central{color:#298c62}
.precision-legend-stabilized{color:#6b7ec1}
.precision-graph-label,.precision-rate-definition,.precision-warning,.precision-scope{font-size:14px!important;line-height:1.6}
.precision-graph-label,.precision-rate-definition,.precision-scope{color:var(--muted)}
.precision-table-scroll{max-width:100%;overflow-x:auto;border:1px solid var(--line);margin:16px 0}
.precision-table{border-collapse:collapse;width:100%;min-width:560px;font-size:14px;font-variant-numeric:tabular-nums}
.precision-table caption{text-align:left;padding:12px;font-weight:650}
.precision-table th,.precision-table td{padding:10px;text-align:right;border-bottom:1px solid var(--line)}
.precision-table th:first-child{text-align:left}
.precision-table tbody th{font-weight:650}
.precision-table tr:last-child>*{border-bottom:0}
.precision-warning{border-left:3px solid var(--accent);padding:8px 12px;background:var(--washed);margin:16px 0}
.precision-code-details{margin-top:16px}
.precision-code-details pre{margin-top:12px}
.precision-reset{margin-top:16px}
.precision-scope{margin-top:16px}
@media(max-width:500px){.precision-controls{grid-template-columns:1fr;gap:6px}.precision-legend{gap:8px}}

/* J13: interactive least-squares data, with readable controls and numerics. */
.fitting-lab[hidden]{display:none}
.fit-controls{display:grid;grid-template-columns:minmax(160px,auto) minmax(180px,1fr);align-items:center;gap:10px 16px}
.fit-controls label{font-size:14px;font-weight:650}
.fit-controls select{background:var(--surface);border:1px solid var(--line);padding:10px;color:var(--ink);font-size:14px;min-width:0}
.fit-controls input[type=range]{width:100%;min-width:0;accent-color:var(--accent)}
.fit-controls input[type=checkbox]{justify-self:start;width:22px;height:22px;accent-color:var(--accent)}
#fit-chart{width:100%;display:block;margin:16px 0 10px;height:auto;border:1px solid var(--line);background:var(--surface)}
.fit-grid{stroke:var(--line);stroke-width:1}
.fit-tick{font:13px system-ui,sans-serif;fill:var(--muted)}
.fit-reference-line{stroke:#6189c2;stroke-width:2;stroke-dasharray:8 5}
.fit-candidate-line{stroke:#ce7d40;stroke-width:3}
.fit-observation{fill:#298c62;stroke:var(--surface);stroke-width:1}
.fit-residual{stroke:#9e768b;stroke-width:2;stroke-dasharray:3 3}
.fit-legend{display:flex;flex-wrap:wrap;gap:8px 18px;font-size:14px}
.fit-legend span{display:inline-flex;align-items:center;gap:7px}
.fit-legend span:before{content:"";width:15px;height:3px;background:currentColor;display:inline-block}
.fit-legend-points{color:#298c62}
.fit-legend-candidate{color:#ce7d40}
.fit-legend-reference{color:#6189c2}
.fit-legend-residual{color:#9e768b}
.fit-values{font-size:14px;margin:20px 0}
.fit-values>div{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--line)}
.fit-values dt{font-weight:650}
.fit-values dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}
.fit-reference{border-left:3px solid var(--accent);padding:12px 14px;background:var(--washed)}
.fit-reference strong{font-size:15px}
.fit-reference p{font-size:14px!important}
.fit-data-scroll{max-width:100%;overflow-x:auto;border:1px solid var(--line);margin:16px 0}
.fit-data-table{border-collapse:collapse;width:100%;min-width:400px;font-size:14px;font-variant-numeric:tabular-nums}
.fit-data-table caption{text-align:left;font-weight:650;padding:12px}
.fit-data-table th,.fit-data-table td{text-align:right;padding:10px;border-bottom:1px solid var(--line)}
.fit-data-table tbody tr:last-child td{border-bottom:0}
.fit-code-details{margin-top:14px}
.fit-code-details pre{margin-top:10px}
.fit-reset{margin-top:16px}
.fit-scope{font-size:14px!important;color:var(--muted);line-height:1.6;margin-top:16px}
@media(max-width:500px){.fit-controls{grid-template-columns:1fr;gap:6px}.fit-values>div{flex-wrap:wrap}.fit-values dd{text-align:left}}

/* J14 program-state predictions: distinct from passive numerical walkthroughs. */
.program-trace[hidden]{display:none}
.program-trace h3{font-size:17px;line-height:1.4;margin:0 0 12px}
.trace-iteration{font-size:14px!important;font-weight:700;color:var(--accent);margin:16px 0 6px}
.trace-before{font-size:15px!important;margin:10px 0 14px}
#trace-prediction-fields>label,#trace-branch-wrap>label{font-size:14px;display:block;font-weight:650;margin:12px 0 7px}
#trace-input,#trace-branch{display:block;width:100%;max-width:350px;background:var(--surface);color:var(--ink);border:1px solid var(--line);padding:10px;font-size:16px}
#trace-branch-wrap[hidden],#trace-prediction-fields[hidden],#trace-finish[hidden],#trace-history-empty[hidden]{display:none}
.trace-actions{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}
.trace-actions .quiet{margin-left:auto}
.trace-feedback{font-size:14px!important;line-height:1.55;padding-left:12px;border-left:3px solid var(--muted);margin:12px 0}
.trace-feedback:empty{display:none}
.trace-feedback[data-result="correct"]{border-left-color:#298c62}
.trace-feedback[data-result="incorrect"]{border-left-color:#b7733a}
.trace-feedback[data-result="invalid"]{border-left-color:#bb4c4c}
.trace-finish{font-size:15px!important;font-weight:650}
.trace-history-wrap{max-width:100%;overflow-x:auto;margin:14px 0}
.trace-history{width:100%;border-collapse:collapse;min-width:350px;font-size:14px;font-variant-numeric:tabular-nums}
.trace-history caption{text-align:left;font-weight:650;padding:10px 0}
.trace-history th,.trace-history td{border-bottom:1px solid var(--line);padding:8px;text-align:left}
.trace-history tbody tr:last-child>*{border-bottom:0}
.trace-scope{font-size:14px!important;color:var(--muted);line-height:1.55}
@media(max-width:500px){.trace-actions .quiet{margin-left:0}.trace-actions button{flex:1;min-width:120px}}

/* J15: numerical factorization stepper, readable matrix values. */
.factor-lab[hidden],.factor-result[hidden],#factor-right-group[hidden],#factor-orthogonality[hidden]{display:none}
.factor-controls{display:grid;grid-template-columns:minmax(150px,auto) minmax(160px,1fr);align-items:center;gap:10px 14px;margin-bottom:18px}
.factor-controls label{font-size:14px;font-weight:650}
.factor-controls select{padding:10px;font-size:14px;color:var(--ink);background:var(--surface);border:1px solid var(--line);min-width:0}
.factor-progress{font-size:14px!important;font-weight:700;color:var(--accent);margin:6px 0}
.factor-operation{font-size:16px!important;line-height:1.5;margin:8px 0}
.factor-explanation{font-size:14px!important;line-height:1.5;color:var(--muted)}
.factor-matrices{display:flex;gap:16px;justify-content:flex-start;align-items:flex-start;flex-wrap:wrap;margin:18px 0}
.factor-matrices>div{min-width:95px}
.factor-matrices h3{font-size:15px;margin:0 0 9px}
.factor-matrix{border-collapse:collapse;font:15px/1.4 "Cascadia Code",Consolas,monospace;font-variant-numeric:tabular-nums}
.factor-matrix td{text-align:right;padding:10px 9px;border:1px solid var(--line);min-width:46px}
.factor-actions{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:15px}
.factor-actions button{flex:1;min-width:100px}
.factor-result{background:var(--washed);border-left:3px solid var(--accent);padding:12px 14px}
.factor-result p{margin:6px 0;font-size:14px!important;line-height:1.5}
.factor-code{margin-top:16px}
.factor-code pre{margin-top:12px}
.factor-reset{margin-top:16px}
.factor-scope{font-size:14px!important;color:var(--muted);line-height:1.6;margin-top:16px}
@media(max-width:520px){.factor-controls{grid-template-columns:1fr;gap:7px}.factor-matrices{gap:12px}.factor-matrix td{padding:8px 6px;min-width:39px}}

/* J16 condition-number learning: matrix/solution metrics and comparable data. */
.sensitivity-lab[hidden]{display:none}
.sensitivity-controls{display:grid;grid-template-columns:minmax(170px,auto) minmax(150px,1fr);align-items:center;gap:10px 14px}
.sensitivity-controls label{font-size:14px;font-weight:650}
.sensitivity-controls select{background:var(--surface);color:var(--ink);border:1px solid var(--line);padding:10px;font-size:14px;min-width:0}
.sensitivity-equations{display:flex;gap:8px 24px;flex-wrap:wrap;margin:18px 0}
.sensitivity-equations p{font:15px/1.4 "Cascadia Code",Consolas,monospace!important;margin:0}
.sensitivity-metrics{margin:16px 0;font-size:14px;line-height:1.45}
.sensitivity-metrics>div{display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);padding:8px 0}
.sensitivity-metrics dt{font-weight:650}
.sensitivity-metrics dd{margin:0;min-width:78px;text-align:right;font-variant-numeric:tabular-nums}
.sensitivity-direction{font-size:14px!important;line-height:1.55;border-left:3px solid var(--accent);padding:9px 12px;background:var(--washed)}
#sensitivity-chart{display:block;width:100%;height:auto;background:var(--surface);border:1px solid var(--line);margin:16px 0 8px}
.sensitivity-grid{stroke:var(--line);stroke-width:1}
.sensitivity-chart-label{fill:var(--muted);font:12px system-ui,sans-serif}
.sensitivity-line{stroke:#298c62;stroke-width:2.5;fill:none}
.sensitivity-point{fill:#298c62}
.sensitivity-point.selected{fill:#b7733a;stroke:var(--surface);stroke-width:2}
.sensitivity-chart-note,.sensitivity-scope{font-size:14px!important;line-height:1.55;color:var(--muted)}
.sensitivity-table-scroll{max-width:100%;overflow-x:auto;border:1px solid var(--line);margin:16px 0}
.sensitivity-table{border-collapse:collapse;width:100%;min-width:610px;font-size:14px;font-variant-numeric:tabular-nums}
.sensitivity-table caption{text-align:left;font-weight:650;padding:11px}
.sensitivity-table th,.sensitivity-table td{padding:9px 10px;text-align:right;border-bottom:1px solid var(--line)}
.sensitivity-table th:first-child{text-align:left}
.sensitivity-table tr:last-child>*{border-bottom:0}
.sensitivity-table tr.sensitivity-selected>*{background:var(--active)}
.sensitivity-code{margin-top:16px}
.sensitivity-code pre{margin-top:12px}
.sensitivity-reset{margin-top:16px}
.sensitivity-scope{margin-top:14px}
@media(max-width:520px){.sensitivity-controls{grid-template-columns:1fr;gap:7px}.sensitivity-metrics>div{flex-wrap:wrap}.sensitivity-metrics dd{text-align:left}}

/* J17 independent task selection shares the canonical Julia editor. */
.practice-switch{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin:4px 0 16px}
.practice-switch label{font-size:14px;font-weight:650;min-width:90px}
.practice-switch select{flex:1;min-width:185px;max-width:470px;background:var(--surface);color:var(--ink);font-size:15px;padding:10px;border:1px solid var(--line)}
#transfer-plan[hidden],#transfer-tests[hidden],#hint-1[hidden],#hint-2[hidden],#hint-3[hidden]{display:none}

/* J18 Julia stdlib Test handoff shares the lesson editor and file export. */
#external-tests[hidden]{display:none}
.external-tests{border-top:1px solid var(--line);margin-top:18px;padding-top:16px}
.external-tests h3{font-size:17px;margin:0 0 12px}
.external-tests ol{font-size:14px;line-height:1.55;padding-left:24px;overflow-wrap:anywhere}
.external-tests ol li{margin:5px 0}
.external-test-actions{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}
.external-test-actions button{flex:0 1 auto}
.external-tests details pre{max-height:350px;overflow:auto;margin-top:10px}
.external-test-run{font-size:14px!important;line-height:1.55;color:var(--muted);margin:12px 0}
@media(max-width:510px){.external-test-actions button{width:100%;flex:1 1 100%}}

/* J19: local and ephemeral interpretation of pasted Julia Test messages. */
#external-report-details{margin-top:16px}
#external-report-details label{display:block;font-size:14px;font-weight:650;margin:10px 0 6px}
#external-report-input{display:block;box-sizing:border-box;width:100%;min-height:126px;max-width:100%;background:var(--surface);color:var(--ink);border:1px solid var(--line);padding:12px;font:14px/1.5 "Cascadia Code",Consolas,monospace}
#external-report-inspect{margin:10px 0}
#external-report-results{font-size:14px;line-height:1.55;overflow-wrap:anywhere}
#external-report-results p{font-size:14px!important;margin:8px 0}

/* Focused regression reproduction reuses original editor and Julia stdlib Test. */
.external-focus{border-top:1px solid var(--line);margin-top:18px;padding-top:14px}
.external-focus label{font-size:14px;font-weight:650;display:block;margin-bottom:8px}
.external-focus select{padding:10px;max-width:420px;width:100%;font-size:15px;background:var(--surface);color:var(--ink);border:1px solid var(--line)}
.external-focus-instruction{font-size:14px!important;line-height:1.5;margin:12px 0}
#external-focus-details pre{max-height:350px;overflow:auto;margin:10px 0}

/* Source-authored metamorphic relations on the original code editor. */
.property-lab[hidden],#property-reason[hidden],#property-code-details[hidden]{display:none}
.property-lab{border-top:1px solid var(--line);margin-top:18px;padding-top:16px}
.property-lab h3{font-size:17px;margin:0 0 12px}
.property-lab label{font-size:14px;font-weight:650;display:block;margin:8px 0}
.property-lab select{background:var(--surface);color:var(--ink);border:1px solid var(--line);padding:10px;font-size:15px;max-width:420px;width:100%}
#property-question{font-size:15px!important;line-height:1.55;margin:14px 0}
#property-reason p{font-size:14px!important;line-height:1.55;margin:8px 0}
#property-code-details pre{max-height:350px;overflow:auto;margin:10px 0}

/* J22 function decomposition uses one existing Julia editor and source-backed contracts. */
.algorithm-design[hidden]{display:none}
.algorithm-design{border-top:1px solid var(--line);margin-top:18px;padding-top:16px}
.algorithm-design h3{font-size:17px;margin:0 0 12px}
.algorithm-contract{margin:12px 0 18px;font-size:14px}
.algorithm-contract>div{display:grid;grid-template-columns:100px minmax(0,1fr);gap:12px;padding:8px 0;border-bottom:1px solid var(--line)}
.algorithm-contract dt{font-weight:650}
.algorithm-contract dd{margin:0}
#algorithm-design-stages{padding-left:22px;margin:12px 0}
#algorithm-design-stages li{font-size:14px;line-height:1.55;margin:12px 0;overflow-wrap:anywhere}
#algorithm-design-stages li>p{font-size:14px!important;line-height:1.55;margin:4px 0 8px}
#algorithm-design-stages details p{font-size:14px!important;line-height:1.55;margin:6px 0}
#algorithm-scaffold-details pre{max-height:340px;overflow:auto;margin:10px 0}
@media(max-width:520px){.algorithm-contract>div{grid-template-columns:1fr;gap:3px}}

/* Cross-lesson export reads existing browser-local drafts at export time. */
.integration-handoff[hidden]{display:none}
.integration-handoff{border-top:1px solid var(--line);margin-top:18px;padding-top:16px}
.integration-handoff h3{font-size:17px;margin:0 0 12px}
.integration-source-status{font-size:14px;margin:12px 0}
.integration-source-status>div{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:12px;padding:8px 0;border-bottom:1px solid var(--line)}
.integration-source-status dt{font-weight:650}
.integration-source-status dd{margin:0}
.integration-instruction{font-size:14px!important;line-height:1.5}
#integration-preview-details pre{max-height:350px;overflow:auto;margin:10px 0}
@media(max-width:560px){.integration-source-status>div{grid-template-columns:1fr;gap:4px}}

.local-plot-preview{border-top:1px solid var(--line);padding:20px 0}
.local-plot-preview h3,.course-practice h2{font-size:20px;line-height:1.25;margin:0 0 12px}
.local-plot-preview p,.course-practice p,.course-practice label,.local-plot-preview label{font-size:14px;line-height:1.55}
.local-plot-preview label,.course-practice label{display:block;font-weight:650;margin:8px 0}
.local-plot-preview input{display:block;width:100%;max-width:100%;font-size:14px;padding:10px 0}
.plot-image-holder{max-width:100%;overflow:auto}
.plot-image-holder img{display:block;max-width:100%;height:auto;max-height:480px;object-fit:contain;margin:12px auto;border:1px solid var(--line);background:#fff}
.plot-image-holder img[hidden],.local-plot-preview[hidden],.course-practice[hidden]{display:none}
.local-plot-preview .feedback,.course-practice .feedback{font-size:14px;overflow-wrap:anywhere}
.local-plot-preview button{margin-top:8px}
.course-practice{border-top:1px solid var(--line);padding-top:22px}
.course-practice h3{font-size:16px;line-height:1.4;margin:10px 0}
.course-practice select{width:100%;max-width:450px;min-height:42px;font-size:14px;margin-bottom:12px}
.practice-code{overflow:auto;max-width:100%;white-space:pre;max-height:400px;font-size:13px}
.practice-table-wrap{overflow:auto;max-width:100%;margin:12px 0}
.practice-table{border-collapse:collapse;width:100%;min-width:340px;font-variant-numeric:tabular-nums;font-size:13px}
.practice-table caption{text-align:left;color:var(--muted);font-size:14px;padding:8px 0}
.practice-table td,.practice-table th{text-align:right;border-bottom:1px solid var(--line);padding:9px 10px;white-space:nowrap}
.practice-table th{text-align:left}

.local-runner{padding:18px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin:16px 0}
.local-runner h3{font-size:19px;line-height:1.3;margin:0 0 10px}
.local-runner p,.local-runner label,.local-runner code{font-size:14px;line-height:1.55}
.local-runner label{display:block;font-weight:650;margin:13px 0 7px}
.local-runner input{min-height:42px;max-width:100%;width:100%;padding:8px 10px;font-size:16px;background:var(--surface);color:var(--ink);border:1px solid var(--line)}
.local-runner-actions{display:flex;gap:9px;flex-wrap:wrap;margin:12px 0}
.local-runner-actions button{min-height:42px}
.local-runner .feedback{font-size:14px;overflow-wrap:anywhere}
.local-runner-console{font:13px/1.6 Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;overflow:auto;margin:10px 0;color:var(--ink);background:var(--washed);padding:12px}
.local-runner-console:empty{display:none}
.local-runner-images figure{margin:16px 0;max-width:100%}
.local-runner-images img{display:block;max-width:100%;height:auto;max-height:450px;object-fit:contain;background:#fff}
.local-runner-images figcaption{font-size:14px;color:var(--muted);margin-top:7px}
@media(max-width:760px){.local-runner-actions button{flex:1;min-width:140px}}

.amp-workshop{border-top:1px solid var(--line);padding-top:20px}
.amp-workshop[hidden]{display:none}
.amp-workshop h2{font-size:22px;line-height:1.3;margin:0 0 12px;letter-spacing:-.015em}
.amp-workshop h3{font-size:17px;margin:22px 0 10px;line-height:1.35}
.amp-workshop p,.amp-workshop label,.amp-workshop li{font-size:14px;line-height:1.55}
.amp-workshop label{display:block;font-weight:650;margin:0 0 6px}
.amp-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px;margin:16px 0}
.amp-controls select,.amp-workshop>select{width:100%;max-width:100%;min-height:44px;font-size:14px;background:var(--surface);color:var(--ink);border:1px solid var(--line);padding:8px}
.amp-table-scroll{overflow:auto;max-width:100%;margin:14px 0}
.amp-table{border-collapse:collapse;width:100%;font-size:13px;font-variant-numeric:tabular-nums}
.amp-table-scroll .amp-table{min-width:540px}
.amp-table caption{text-align:left;font-size:14px;color:var(--muted);padding:9px 0}
.amp-table th,.amp-table td{padding:9px;border-bottom:1px solid var(--line);text-align:right;white-space:nowrap}
.amp-table th:first-child{text-align:left}
.amp-summary th{font-weight:500;color:var(--muted)}
.amp-workshop svg{width:100%;max-width:600px;height:auto;overflow:visible;display:block;margin:15px 0 2px}
.amp-grid-line{stroke:var(--line);stroke-width:1}
.amp-line{stroke:var(--accent);stroke-width:3;fill:none}
.amp-point{fill:var(--accent)}
.amp-svg-label{font-size:12px;fill:var(--muted)}
.amp-source{margin:14px 0}
.amp-source summary{font-size:14px;cursor:pointer;font-weight:650}
.amp-source pre{max-width:100%;overflow:auto;white-space:pre;max-height:400px;font-size:13px}
.amp-actions{display:flex;gap:9px;flex-wrap:wrap}
.amp-actions button{min-height:42px}
.amp-workshop .feedback{font-size:14px;overflow-wrap:anywhere}
@media(max-width:760px){.amp-actions button{width:100%}.amp-controls{grid-template-columns:1fr}}

/* Document export controls and native text-selectable browser PDF printing */
.submission-workflow{margin:18px 0}
.submission-workflow summary{cursor:pointer;font-size:18px;line-height:1.35;font-weight:700}
.submission-content{padding-top:16px}
.submission-content p,.submission-content label,.submission-content li{font-size:14px;line-height:1.55}
.submission-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:13px;margin:14px 0}
.submission-fields label,.submission-content>label:not(.submission-check){display:block;font-weight:650;margin:0 0 7px}
.submission-fields input{width:100%;max-width:100%;min-height:44px;padding:9px;font-size:16px;background:var(--surface);color:var(--ink);border:1px solid var(--line)}
.submission-content input[type=file]{font-size:14px;width:100%;max-width:100%;padding:11px 0}
.submission-check{display:flex;align-items:start;gap:9px;margin:14px 0}
.submission-check input{margin-top:5px;flex:0 0 auto}
.submission-actions{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}
.submission-actions button,.submission-content>button{min-height:42px}
#submission-items{list-style:none;padding:0;margin:7px 0}
#submission-items li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
#submission-items button{min-height:38px;flex:0 0 auto}
.submission-caveat{margin-top:18px}
#submission-print{display:none}
@media(max-width:760px){.submission-fields{grid-template-columns:1fr}.submission-actions button{flex:1}}
@media print{
  @page{size:A4;margin:18mm}
  body{background:white!important;color:#111!important;display:block!important}
  body > *:not(#submission-print){display:none!important}
  #submission-print{display:block!important;color:#111!important;max-width:none!important;font-family:Arial,sans-serif}
  #submission-print-title{font-size:15pt;font-weight:700;overflow-wrap:anywhere;margin:0 0 5mm}
  #submission-print-meta{font-size:10pt;margin:0 0 8mm}
  #submission-print-source{font-family:Consolas,"DejaVu Sans Mono",monospace;font-size:9.5pt;line-height:1.45;
    white-space:pre-wrap;overflow-wrap:anywhere;word-break:normal;color:#111!important;margin:0}
}


/* Canonical lesson depth panel: actual code/proof content, no secondary progress UI. */
.completion-depth[hidden],.completion-depth [hidden]{display:none!important}
.completion-depth{border-top:1px solid var(--line);padding-top:22px}
.completion-depth h2{font-size:21px;line-height:1.35;margin:0 0 14px}
.completion-depth h3{font-size:17px;line-height:1.35;margin:20px 0 9px}
.completion-depth p,.completion-depth ol,.completion-depth label{font-size:14px;line-height:1.6}
.completion-depth label{display:block;font-weight:650;margin:12px 0 6px}
.completion-depth select{width:100%;max-width:100%;min-height:44px;background:var(--surface);color:var(--ink);border:1px solid var(--line);padding:8px;font-size:15px}
/* G1/G2 WebKit mobile: the original Julia source scrolls *inside* its pre,
   never expands the page inline size. Keep long lines and source bytes intact. */
.completion-depth,.completion-depth>div,#completion-tracks,
#completion-proofs,#completion-experiments{min-width:0;max-width:100%;box-sizing:border-box}
.completion-depth pre{display:block;box-sizing:border-box;min-width:0;
  width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;
  white-space:pre;font:13px/1.55 Consolas,monospace}
.completion-depth pre>code{white-space:pre}
/* WebKit on narrow touch viewports includes long inline code ink in the
   document width even when the owning pre scrolls. Wrap *only* these
   display-only references; no source text, editors or exports are changed. */
@media(max-width:600px){
  .completion-depth pre,.completion-depth pre>code{
    white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;
    max-width:100%;min-width:0}
}
.completion-depth ol{padding-left:24px}
.completion-depth li{margin:0 0 8px}
.completion-actions{display:flex;flex-wrap:wrap;gap:9px;margin:13px 0}
.completion-actions button,.completion-depth button{min-height:42px}
.completion-source{color:var(--muted)}
.completion-warning{border-left:3px solid var(--ink);padding:10px 13px}
#completion-proofs,#completion-experiments{border-top:1px solid var(--line);margin-top:20px;padding-top:12px}
@media(max-width:760px){.completion-actions button,.completion-depth>div>button{width:100%}}


.course-backup{margin:18px 0}
.course-backup summary{cursor:pointer;font-size:18px;font-weight:700}
.course-backup>p,.course-backup>label{display:block;font-size:14px;line-height:1.55;margin:12px 0}
.course-backup>label{font-weight:650}
.course-backup button{min-height:44px;margin:8px 8px 8px 0}
.course-backup input[type=file],.course-backup select{width:100%;max-width:100%;min-height:44px;font-size:15px}
.course-backup select{border:1px solid var(--line);color:var(--ink);background:var(--surface);padding:8px}
.course-backup .backup-confirm{display:flex;align-items:start;gap:10px;font-weight:500}
@media(max-width:760px){.course-backup button{width:100%}}

/* Independent QR/normal-equation comparison: readable data and horizontal mobile tables. */
.linear-methods[hidden]{display:none}
.linear-methods label{display:block;font-size:15px;font-weight:650;margin-bottom:7px}
.linear-methods select{color:var(--ink);background:var(--surface);border:1px solid var(--line);min-height:44px;font-size:15px;padding:9px 12px;max-width:100%;width:100%}
.linear-method-grid{display:grid;grid-template-columns:minmax(180px,1fr) minmax(200px,1fr);gap:20px;align-items:start;margin:17px 0}
.linear-method-grid p{font-size:15px;line-height:1.55}
.linear-method-rank{font-weight:650}
.linear-method-scroll{max-width:100%;overflow-x:auto}
.linear-method-table{border-collapse:collapse;width:100%;font-size:14px;font-variant-numeric:tabular-nums;white-space:nowrap}
.linear-method-table th,.linear-method-table td{padding:10px;text-align:left;border-bottom:1px solid var(--line)}
.linear-method-table tbody th{font-weight:650}
.linear-methods details{margin-top:20px}
.linear-methods details summary{font-size:15px}
.linear-methods pre{max-width:100%;white-space:pre;overflow-x:auto}
.linear-method-boundary{font-size:14px!important;line-height:1.5;color:var(--muted);margin-top:17px}
@media(max-width:650px){.linear-method-grid{grid-template-columns:1fr;gap:0}}

/* Actual local Julia test output sits beside the corresponding generated test contract. */
#external-test-local-output,#completion-test-local-output{max-height:280px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px}
#external-test-local-status,#completion-test-local-status{font-size:14px!important;line-height:1.55}

/* Explicit offline-install and update controls; meaningful status only. */
#offline-indicator{font-size:14px;font-weight:650;color:var(--accent);white-space:nowrap}
.offline-access{border-top:1px solid var(--line);margin:16px 0;padding:14px 0}
.offline-access summary{cursor:pointer;font-size:16px;font-weight:650}
.offline-access p{font-size:14px;line-height:1.6;margin:10px 0}
.offline-actions{display:flex;gap:9px;flex-wrap:wrap}
.offline-actions button{min-height:42px;font-size:14px}
.offline-actions button[hidden],#offline-indicator[hidden]{display:none}
@media(max-width:760px){#offline-indicator{font-size:14px}.offline-actions button{flex:1 1 100%}}

/* Original Julia numerical experiment output, never a learner grade. */
#completion-experiment-local-output{max-height:320px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px}
#completion-experiment-local-status{font-size:14px!important;line-height:1.55}

/* Execution evidence directly beside the canonical repair editor. */
#repair-run-output{max-height:290px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px}
#repair-run-status{font-size:14px!important;line-height:1.55}


/* Mixed exam rehearsal: ordinary course content, no new navigation surface. */
.rehearsal-open{display:block;width:100%;margin-top:14px;text-align:left}
.semester-rehearsal{border-top:1px solid var(--line);padding-top:15px}
.semester-rehearsal>summary{font-size:18px;font-weight:700;color:var(--ink)}
.rehearsal-topline{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:16px 0}
.rehearsal-topline p{margin:0;color:var(--muted);font-size:14px}
.rehearsal-item{border-top:1px solid var(--line);padding:24px 0}
.rehearsal-meta{font-size:13px!important;color:var(--muted);margin:0 0 6px}
.rehearsal-title{font-size:17px;line-height:1.35;margin:0 0 10px}
.rehearsal-question{font-weight:650;margin:0 0 10px}
.rehearsal-context{margin:0 0 12px}
.rehearsal-working{width:100%;min-height:100px;resize:vertical;padding:12px;font-size:14px;
  color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:2px}
.rehearsal-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:12px}
.rehearsal-approach{margin-top:15px;padding:14px 17px;border-left:3px solid var(--accent);
  background:var(--washed)}
.rehearsal-approach h4{font-size:15px;margin:0 0 8px}
.rehearsal-approach ol{margin:0 0 10px;padding-left:20px;font-size:14px}
.rehearsal-approach p{margin:10px 0 0}
.rehearsal-warning{font-weight:600}
/* Phase 08 — compact, ungraded source review. Read-only assertions wrap on mobile. */
.rehearsal-comparison{margin-top:14px;padding:12px 14px;border:1px solid var(--line);
  border-radius:6px;background:var(--surface);min-width:0}
.rehearsal-comparison>summary{cursor:pointer;font-weight:650}
.rehearsal-comparison-body{display:grid;gap:11px;margin-top:13px;min-width:0}
.rehearsal-comparison-source h4,.rehearsal-source-checks h4,.rehearsal-check-worksheet h4,.rehearsal-transfer-review h4{
  font-size:14px;margin:0 0 4px}
.rehearsal-comparison-source p,.rehearsal-comparison-notes p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.rehearsal-source-check{display:grid;gap:3px;padding:8px 0;border-top:1px solid var(--line)}
.rehearsal-source-check code{display:block;padding:8px;border-radius:4px;
  font-size:12px;line-height:1.5;background:var(--washed);white-space:pre-wrap;overflow-wrap:anywhere;
  min-width:0}
.rehearsal-comparison-notes,.rehearsal-transfer-review{border-top:1px solid var(--line);
  padding-top:13px;margin-top:13px;min-width:0}
.rehearsal-comparison-notes h4{font-size:14px;margin:10px 0 4px}
.rehearsal-check-worksheet{border-top:1px solid var(--line);padding-top:13px;min-width:0}
.rehearsal-check-field{margin:12px 0;min-width:0}
.rehearsal-check-field label{display:block;font-size:14px;font-weight:600;margin-bottom:5px}
.rehearsal-check-note{display:block;width:100%;box-sizing:border-box;min-height:76px;padding:10px;
  resize:vertical;border:1px solid var(--line);border-radius:4px;
  color:var(--ink);background:var(--surface);font-size:14px;line-height:1.5}
.rehearsal-check-progress{color:var(--muted);font-size:14px;margin:10px 0}
.rehearsal-review-field{margin:12px 0;min-width:0}
.rehearsal-review-field label{display:block;font-size:14px;font-weight:600;margin-bottom:5px}
.rehearsal-review-input{display:block;width:100%;box-sizing:border-box;min-height:76px;padding:10px;
  resize:vertical;border:1px solid var(--line);border-radius:4px;
  color:var(--ink);background:var(--surface);font-size:14px;line-height:1.5}
.rehearsal-review-progress{color:var(--muted);font-size:13px;margin:10px 0 0}

@media(max-width:760px){.rehearsal-topline{align-items:stretch;flex-direction:column}
  .rehearsal-actions>button{flex:1 1 155px}}


/* R2 — single active design system. Canonical numerical component geometry above
   is retained; app-level composition and tokens are owned here, not layered CSS. */
:root{
  --canvas:#f8f7f5;--surface:#fff;--surface-muted:#f0efed;
  --ink:#1c222c;--muted:#596270;--line:#d9dce0;
  --accent:#6543b2;--accent-soft:#f0ebfb;--success:#147d60;
  --warning:#a36217;--error:#b33740;--code-bg:#111823;
  --deep:#1c222c;--washed:#f0efed;--active:#f0ebfb;
  --r2-header:64px; color-scheme:light;
  font-family:Inter,"Segoe UI",system-ui,-apple-system,sans-serif;font-size:16px;
}
html{scroll-behavior:smooth;scroll-padding-top:176px}
body{margin:0;background:var(--canvas);color:var(--ink);line-height:1.6;
  -webkit-font-smoothing:antialiased;overflow-x:clip}
button,input,select,textarea{font:inherit}
button{cursor:pointer;touch-action:manipulation}
button:focus-visible,a:focus-visible,select:focus-visible,
textarea:focus-visible,summary:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
[hidden],.r2-question-inactive,.r2-mixed-inactive,.r2-lab-inactive{display:none!important}
.topbar{height:var(--r2-header);position:sticky;top:0;z-index:60;display:flex;
  justify-content:space-between;padding:0 clamp(16px,3vw,48px);
  background:#141820;color:#edf0f6;border-bottom:1px solid #272d39;
  align-items:center;box-shadow:none;min-height:0}
.brand{gap:12px;min-width:0}
.brand-mark{background:#6543b2;color:#fff;border-radius:3px;width:40px;height:40px;
  font:800 27px "Cascadia Code",Consolas,monospace;display:grid;place-items:center}
.brand-mark span{color:#b5a2ff}
.brand strong{font-size:16px;letter-spacing:-.035em;color:#f4f4f7}
.brand small{font-size:12px;line-height:1.25;max-width:none;color:#bbc3d0}
.top-right{display:flex;align-items:center;gap:12px}
.top-right .course,.top-right #settings-toggle{display:none!important}
.r2-global-nav{display:flex;align-items:center;gap:6px}
.r2-global-nav button{border:0;background:transparent;padding:10px 15px;
  min-height:44px;color:#b9c2ce;font-size:14px;font-weight:650;
  border-radius:2px;white-space:nowrap}
.r2-global-nav button:hover{background:#252c39;color:#fff}
.r2-global-nav button[aria-current="page"]{background:#332b4c;color:#f0e9ff}
.shell{display:block;max-width:none;min-height:calc(100dvh - var(--r2-header));margin:0}
.r2-page{max-width:1290px;margin:0 auto;padding:clamp(24px,4vw,64px) clamp(18px,4vw,60px) 110px;
  min-width:0}
.r2-kicker{display:block;font-size:12px;font-weight:760;letter-spacing:.12em;
  color:var(--accent);margin-bottom:13px}

/* Course path uses a syllabus and a real Julia example, not a grid of dashboard cards. */
.r2-course{max-width:1250px}
.r2-course-hero{background:transparent;border:0;border-bottom:1px solid var(--line);
  padding:12px 0 28px;display:block}
.r2-course-identity{display:flex;align-items:center;flex-wrap:wrap;gap:12px;
  font-size:13px;font-weight:700;color:var(--muted)}
.r2-course-language{background:#6543b2;color:#fff;font:800 13px/1 "Cascadia Code",Consolas,monospace;
  padding:9px 12px;letter-spacing:.02em}
.r2-course-hero-main{display:flex;justify-content:space-between;align-items:end;
  gap:32px;margin-top:21px}
.r2-course-hero h1{font-size:clamp(32px,4vw,49px);line-height:1.13;
  letter-spacing:-.052em;font-weight:770;margin:0;color:var(--ink)}
.r2-course-hero p{font-size:15px;color:var(--muted);margin:13px 0 0}
.r2-course-hero-actions{display:grid;justify-items:end;gap:12px;flex:none}
#r2-course-progress{font:600 13px/1.5 "Cascadia Code",Consolas,monospace;
  color:var(--muted);text-align:right}
.r2-button,.primary,.secondary{
  min-height:44px;border:1px solid var(--line);padding:11px 17px;border-radius:3px;
  font-size:14px;line-height:1.3;font-weight:680;display:inline-flex;
  justify-content:center;align-items:center;gap:8px;letter-spacing:0;
}
.r2-primary,.primary{background:var(--accent);border-color:var(--accent);color:#fff}
.r2-primary:hover,.primary:hover{background:#4d328d;border-color:#4d328d;color:#fff}
.r2-secondary,.secondary{background:var(--surface);border-color:#b7bec9;color:var(--ink)}
.r2-secondary:hover,.secondary:hover{background:var(--surface-muted);color:var(--ink)}
.r2-text{background:transparent;border-color:transparent;color:var(--accent)}
.r2-text:hover{background:var(--accent-soft)}
.r2-course-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(310px,39%);
  align-items:start;gap:clamp(23px,3.3vw,48px);margin-top:28px}
.r2-course-path{min-width:0;grid-column:1;grid-row:1}
.r2-course-heading{margin:0 0 16px}
.r2-course-heading h2{font-size:22px;line-height:1.35;letter-spacing:-.035em;margin:0}
.r2-course-list.sidebar{position:static;height:auto;max-height:none;overflow:visible;
  width:auto;background:transparent;border:0;padding:0;display:block}
.r2-course-list .sidebar-head{display:none}
.r2-course-list #mobile-course-toggle{display:none}
.r2-course-list #nav-items{display:block;max-height:none;overflow:visible;border-top:1px solid var(--line)}
.r2-course-list .nav-group{display:block;overflow:visible;padding:0;margin:0;
  background:transparent;border:0}
.r2-course-list .nav-group h3{margin:0;padding:22px 12px 10px;font-size:14px;
  font-weight:760;color:var(--ink);letter-spacing:0;line-height:1.4;
  border-top:1px solid var(--line)}
.r2-course-list .nav-group:first-child h3{border-top:0}
.r2-course-list .lesson-link{min-height:58px;width:100%;display:flex;gap:16px;
  padding:11px 12px;border-left:3px solid transparent;border-bottom:1px solid #e5e7eb;
  text-decoration:none;white-space:normal;align-items:center;font-size:15px;
  color:var(--ink)}
.r2-course-list .lesson-link:hover,.r2-course-list .lesson-link.active{
  border-left-color:var(--accent);background:var(--accent-soft)}
.r2-course-list .lesson-number{font:700 13px/1.6 "Cascadia Code",Consolas,monospace;
  color:var(--muted);min-width:24px}
.r2-course-list .lesson-link-name{flex:1;min-width:0;line-height:1.4}
.r2-course-list .nav-score{font:600 12px/1.5 "Cascadia Code",Consolas,monospace;
  color:var(--accent);white-space:nowrap}
/* Canonical 16-lesson syllabus: progress reads the original concept evaluator only. */
.r2-course-list .nav-group h3{display:flex;align-items:baseline;justify-content:space-between;
  flex-wrap:wrap;gap:7px 16px}
.r2-group-progress{font-size:13px;color:var(--muted);font-weight:600;letter-spacing:0}
.r2-course-list .lesson-link{align-items:flex-start}
.r2-course-list .lesson-link-name{display:flex;flex-direction:column;gap:5px;
  font-weight:650;line-height:1.45;min-width:0}
.r2-syllabus-details{font-size:14px;line-height:1.5;font-weight:450;color:var(--muted);
  white-space:normal}
.r2-course-list .nav-score{min-width:76px;max-width:105px;white-space:normal;
  text-align:right;font-size:13px;line-height:1.4;font-weight:650}
.r2-course-list .lesson-link[data-checkpoint="reviewed"] .nav-score{color:var(--success)}
.r2-course-list .lesson-link[data-checkpoint="started"] .nav-score{color:var(--accent)}
.r2-preview-checkpoint{margin:0 21px 14px;color:#c9bbff;
  font-size:14px;line-height:1.5;font-weight:650}
.r2-preview-prereqs{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px 12px;
  margin:0 21px 22px;font-size:14px;line-height:1.5}
.r2-preview-prereqs[hidden]{display:none}
.r2-preview-prereqs span{color:#b3c0d2}
.r2-preview-prereqs a{color:#d4c6ff;text-decoration:underline;text-underline-offset:3px}
.r2-preview-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.r2-preview-actions .r2-secondary{background:transparent;color:#ede6ff;border-color:#7f75a3}
.r2-preview-actions .r2-secondary:hover{background:#342c4e;color:#fff}
.r2-preview-actions button[hidden]{display:none}
.r2-lesson-path{display:flex;align-items:center;justify-content:space-between;
  gap:13px 22px;flex-wrap:wrap;width:100%;min-width:0;
  margin-top:13px;padding:16px 0 0;border-top:1px solid var(--line)}
#r2-lesson-prereqs{display:flex;align-items:baseline;flex-wrap:wrap;gap:7px 11px;
  font-size:14px;line-height:1.5}
#r2-lesson-prereqs[hidden]{display:none}
#r2-lesson-prereqs span{color:var(--muted);font-weight:600}
#r2-lesson-prereqs a{color:var(--accent);font-weight:650;text-decoration:underline;
  text-underline-offset:3px}
.r2-lesson-path-actions{display:flex;align-items:center;flex-wrap:wrap;
  gap:10px;min-width:0;margin-left:auto}
#r2-lesson-checkpoint{font-size:14px;color:var(--muted);font-weight:600;margin-right:7px}
.r2-lesson-path-actions button{background:var(--surface);color:var(--ink);
  border:1px solid #b9bdc8;min-height:40px;padding:8px 12px;
  border-radius:3px;font-size:14px;font-weight:650}
.r2-lesson-path-actions button:hover:not(:disabled){border-color:var(--accent);
  background:var(--accent-soft);color:var(--accent)}
.r2-lesson-path-actions button:disabled{opacity:.45;cursor:not-allowed}
.r2-next-lesson{position:sticky;top:calc(var(--r2-header) + 20px);min-width:0;
  grid-column:2;grid-row:1;
  background:#121821;color:#e8edf5;border:1px solid #293447;overflow:hidden}
.r2-preview-header{display:flex;align-items:center;justify-content:space-between;
  gap:12px;padding:17px 21px;border-bottom:1px solid #303a49;
  font:700 12px/1.4 "Cascadia Code",Consolas,monospace;color:#b6acd6}
.r2-preview-header span:last-child{color:#91d3a5}
.r2-next-lesson .r2-preview-lesson{font-size:clamp(21px,2.3vw,28px);line-height:1.28;
  letter-spacing:-.035em;margin:24px 21px 9px;color:#faf9ff}
.r2-next-lesson>p{font-size:15px;line-height:1.65;color:#bbc4d2;
  margin:0 21px 22px}
.r2-preview-file{display:flex;justify-content:space-between;gap:10px;
  padding:11px 19px;border-top:1px solid #303a49;border-bottom:1px solid #303a49;
  background:#1b2330;font:600 13px/1.5 "Cascadia Code",Consolas,monospace}
.r2-preview-file span:last-child{font:500 12px/1.5 system-ui,sans-serif;color:#a7b5c7}
.r2-preview-code{margin:0;padding:24px 21px;min-height:155px;max-width:100%;
  overflow:auto;tab-size:4;font:14px/1.75 "Cascadia Code",Consolas,monospace;
  color:#d6eacb;background:#121821;white-space:pre}
.r2-preview-footer{border-top:1px solid #303a49;padding:19px 21px 21px;
  display:flex;flex-wrap:wrap;justify-content:space-between;gap:14px;align-items:center}
.r2-preview-footer>span{font-size:13px;color:#acb8c9}
.r2-preview-footer .r2-button{background:#a793ee;color:#181320;
  border-color:#a793ee;font-size:13px}
.r2-preview-footer .r2-button:hover{background:#c6bbfa;border-color:#c6bbfa}
main#lesson-main{width:100%;max-width:1390px;margin:0 auto;
  padding:28px clamp(18px,3.8vw,60px) 120px;min-width:0}
.r2-lesson-head{position:relative;display:grid;justify-items:start;gap:5px;
  padding:18px 0 25px}
.r2-breadcrumb{display:flex;align-items:center;gap:10px;
  font-size:13px;color:var(--muted);margin-bottom:12px}
.r2-breadcrumb button{border:0;padding:6px 0;background:transparent;
  font-weight:700;color:var(--accent)}
.r2-lesson-picker{position:absolute;right:0;top:13px;display:flex;
  gap:12px;align-items:center;font-size:13px;color:var(--muted);max-width:285px}
.r2-lesson-picker select{width:230px;min-height:44px;border:1px solid var(--line);
  background:var(--surface);color:var(--ink);border-radius:4px;padding:8px;font-size:14px}
.r2-lesson-head .lesson-meta{font-size:12px;letter-spacing:0;color:var(--muted)}
.r2-lesson-head h1{font-size:clamp(32px,3.5vw,49px);
  line-height:1.15;letter-spacing:-.05em;font-weight:740;margin:9px 0 4px}
.r2-lesson-head .lead{font-size:16px;line-height:1.65;color:var(--muted);margin:0;max-width:68ch}
.r2-stage-tabs{position:sticky;top:var(--r2-header);z-index:40;display:flex;gap:0;
  border-bottom:1px solid var(--line);background:var(--surface);
  padding:0 clamp(6px,1.5vw,18px);min-height:56px;margin:0 0 33px}
.r2-stage-tabs button{font-size:14px;font-weight:700;color:var(--muted);
  background:transparent;border:0;border-bottom:3px solid transparent;
  margin-bottom:-1px;padding:14px 21px;min-width:116px;min-height:56px}
.r2-stage-tabs button span{margin-left:5px}
.r2-stage-tabs button[aria-current="step"]{color:var(--accent);border-bottom-color:var(--accent)}
.r2-stage-tabs button:hover{color:var(--ink);background:var(--surface-muted)}
.r2-stage-content{min-width:0}
.r2-activity{min-width:0;min-height:calc(100dvh - 345px)}
/* Learning article and canonical read-only Julia source. */
.r2-learn,.r2-check{max-width:1260px;margin:0 auto;min-width:0}
.r2-learn .r2-learn-paper{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(330px,.95fr);
  background:var(--surface);border:1px solid var(--line);padding:0;margin:0;min-width:0}
.r2-learn-reading{min-width:0;padding:clamp(24px,3.6vw,48px)}
.r2-learn-reading .section-title{border-bottom:1px solid var(--line);padding:0 0 19px;
  margin:0 0 25px}
.r2-learn-reading .section-title h2{font-size:clamp(22px,2.4vw,29px);
  letter-spacing:-.04em;line-height:1.3}
.r2-learn #lesson-theory{font-size:clamp(17px,1.45vw,19px);line-height:1.8;
  max-width:65ch;color:var(--ink);margin:0;white-space:pre-line}
.r2-example-pane{background:#101722;color:#e7edf8;border-left:1px solid #344154;
  display:flex;flex-direction:column;min-width:0}
.r2-example-head{padding:16px 19px;display:flex;justify-content:space-between;
  align-items:center;flex-wrap:wrap;gap:10px;border-bottom:1px solid #344154;
  background:#1e2938;font:650 14px/1.5 "Cascadia Code",Consolas,monospace}
.r2-example-mode{font:500 13px/1.5 system-ui,sans-serif;color:#bbc8dd;margin-left:9px}
#r2-copy-example{border:1px solid #62728d;border-radius:3px;color:#e7edf8;
  background:transparent;min-height:37px;padding:7px 12px;font-size:14px}
#r2-copy-example:hover{background:#35445a}
.r2-example-pane pre.code{background:#101722;color:#e3edfc;border:0;border-radius:0;
  margin:0;max-width:100%;min-width:0;width:100%;box-sizing:border-box;overflow:auto;
  padding:27px 23px;font:15px/1.85 "Cascadia Code",Consolas,monospace;
  white-space:pre;tab-size:4;flex:1}
.r2-example-actions{border-top:1px solid #344154;padding:16px 19px;
  display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}
#r2-example-source{color:#bbc8dd;font-size:14px;line-height:1.5}
#r2-example-code{background:#aa99ec;color:#191529;border-color:#aa99ec}
#r2-example-code:hover{background:#cec3fc;border-color:#cec3fc}
#r2-example-feedback{flex:1 1 100%;color:#d8e4f3;font-size:14px}
.r2-stage-footer{display:flex;align-items:center;justify-content:space-between;
  flex-wrap:wrap;gap:15px;border-top:1px solid var(--line);
  padding:17px 0;margin-top:18px;font-size:14px;color:var(--muted)}
.r2-question-tools{display:flex;align-items:center;justify-content:space-between;
  flex-wrap:wrap;gap:12px;margin:0 0 19px;padding:0 0 16px;
  border-bottom:1px solid var(--line)}
#r2-question-index{font:650 14px/1.5 "Cascadia Code",Consolas,monospace;color:var(--ink)}
#r2-question-steps{display:flex;align-items:center;gap:8px}
#r2-question-steps button{width:45px;height:43px;min-height:43px;
  border:1px solid var(--line);border-radius:3px;background:var(--surface);
  color:var(--ink);font:650 14px "Cascadia Code",Consolas,monospace}
#r2-question-steps button[aria-current="step"]{border-color:var(--accent);
  background:var(--accent-soft);box-shadow:inset 0 -3px var(--accent)}
#r2-question-steps button[data-state="Correct"]{color:var(--success);border-color:var(--success)}
#r2-question-steps button[data-state="Try again"]{color:var(--error);border-color:var(--error)}
.r2-check-layout{display:grid;grid-template-columns:minmax(0,1.28fr) minmax(280px,.72fr);
  gap:0;align-items:stretch;min-width:0;border:1px solid var(--line);background:var(--surface)}
.r2-check .r2-check-paper{min-width:0;margin:0;border:0;padding:clamp(23px,3.5vw,44px);
  background:var(--surface)}
.r2-check .section-title{border-bottom:1px solid var(--line);margin:0 0 21px;padding:0 0 16px}
.r2-check .section-title h2{font-size:23px;font-weight:720;letter-spacing:-.035em}
.r2-check .section-intro{font-size:15px;line-height:1.6;color:var(--muted);margin-bottom:20px}
.r2-check .question{border:0;padding:0;margin:0}
.r2-check .question-head{display:flex;align-items:center;gap:14px;
  font-size:14px;color:var(--muted);font-weight:650}
.r2-check .question h3{font-size:clamp(21px,2.4vw,29px);font-weight:670;
  letter-spacing:-.025em;margin:20px 0 26px;line-height:1.46}
.r2-check .choices{display:grid;grid-template-columns:1fr;gap:10px}
.r2-check .choice{min-height:58px;padding:13px 16px;border:1px solid var(--line);
  background:var(--surface);font-size:16px;text-align:left;border-radius:3px;
  display:flex;gap:14px;align-items:center;line-height:1.5}
.r2-check .choice>span{flex:0 0 31px;display:grid;place-items:center;
  min-height:31px;border:1px solid var(--line);
  color:var(--muted);font:700 14px "Cascadia Code",Consolas,monospace}
.r2-check .choice:hover{border-color:var(--accent);background:var(--surface-muted)}
.r2-check .choice.selected{border-color:var(--accent);background:var(--accent-soft)}
.r2-check .choice.selected>span{border-color:var(--accent);color:var(--accent)}
.r2-check .answer-reason{font-size:16px;line-height:1.7;padding:16px 18px;
  border-left:3px solid var(--line);background:var(--surface-muted)}
.r2-check .answer-reason.right{border-left-color:var(--success)}
.r2-check .answer-reason.wrong{border-left-color:var(--error)}
.r2-check .question-hint{margin-top:18px;font-size:15px;line-height:1.6}
.r2-check .question-hint summary{cursor:pointer;min-height:40px;padding:8px 0}
.r2-check #concept-brief{font-size:15px;color:var(--muted);line-height:1.6;
  border-top:1px solid var(--line);padding:16px 0 0;margin-top:27px}
.r2-check-reference{min-width:0;display:flex;flex-direction:column;
  background:#111923;color:#e7edf8;border-left:1px solid #344154}
.r2-check-reference-head{display:flex;align-items:center;justify-content:space-between;
  gap:12px;flex-wrap:wrap;padding:16px 20px;background:#202a39;border-bottom:1px solid #344154;
  font:650 14px/1.5 "Cascadia Code",Consolas,monospace}
.r2-check-reference-head span:last-child{font:500 13px/1.5 system-ui,sans-serif;color:#bbc8dd}
.r2-check-reference-code{flex:1;min-width:0;width:100%;max-width:100%;box-sizing:border-box;margin:0;
  padding:24px 20px;color:#d8e8fc;background:#111923;overflow:auto;
  font:14px/1.8 "Cascadia Code",Consolas,monospace;tab-size:4;white-space:pre}
.r2-check-reference-actions{display:flex;align-items:center;flex-wrap:wrap;gap:11px;
  padding:15px 20px;border-top:1px solid #344154}
.r2-check-reference-actions span{flex:1 1 100%;color:#c4cfe0;font-size:14px}
.r2-check-reference-actions button{min-height:42px;padding:9px 14px;
  border:1px solid #62728d;border-radius:3px;background:#28374c;
  color:#f0f3fb;font-size:14px;font-weight:650}
.r2-check-reference-actions button:hover{background:#364c67}
#r2-check-code-button{background:#ae9aec;color:#20182b;border-color:#ae9aec}
#r2-check-code-button:hover{background:#d1c3fc}
/* One Julia workspace: canonical editor, terminal, source tools and task reference. */
.r2-code-layout{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(285px,.8fr);
  min-width:0;align-items:start;background:var(--surface);border:1px solid var(--line);
  min-height:720px}
.r2-instructions{position:sticky;top:calc(var(--r2-header) + 78px);max-height:calc(100dvh - var(--r2-header) - 94px);
  min-width:0;overflow:auto;overflow-wrap:anywhere;border-left:1px solid var(--line);
  padding:0;background:var(--surface)}
.r2-instructions>summary{display:flex;flex-direction:column;gap:6px;cursor:pointer;
  padding:17px 20px;border-bottom:1px solid var(--line);font-size:14px;
  line-height:1.4;list-style:none;position:sticky;top:0;z-index:2;
  background:var(--surface)}
.r2-instructions>summary::-webkit-details-marker{display:none}
.r2-instructions>summary:focus-visible{outline-offset:-3px}
.r2-task-summary strong{font-size:15px;color:var(--ink)}
#r2-task-summary-text{font-size:14px;line-height:1.55;color:var(--muted)}
.r2-instructions>.paper{padding:20px;margin:0;border:0;box-shadow:none;background:transparent}
.r2-instructions .section-title h2{font-size:20px;letter-spacing:-.035em}
.r2-instructions #challenge-text{font-size:16px;line-height:1.7}
.r2-instructions .code{font-size:13px;padding:14px;border:0;border-radius:2px;
  color:#e8eaf4;background:#111823;max-width:100%;overflow:auto}
.r2-instructions .section-intro{font-size:14px;color:var(--muted)}
.r2-instructions #go-to-compiler{display:none!important}
.r2-instructions #integration-handoff{font-size:14px;scroll-margin-top:145px}
.r2-editor{min-width:0;background:#121923;color:#eaf0f7;padding:0;overflow:hidden}
.r2-editor-head{display:flex;justify-content:space-between;align-items:center;
  flex-wrap:wrap;gap:12px;min-height:54px;margin:0;padding:0 18px;
  background:#1e2938;border-bottom:1px solid #394456}
.r2-file-tab{align-self:stretch;display:flex;align-items:center;gap:10px;
  border-bottom:2px solid #ae97ec;padding:10px 4px 8px;
  font:650 14px/1.5 "Cascadia Code",Consolas,monospace}
.r2-file-badge{display:inline-flex;place-items:center;padding:2px 5px;color:#d8cafa;
  background:#493d67;border-radius:2px;font-size:12px}
#r2-editor-status{font:500 13px/1.5 system-ui,sans-serif;color:#bac8d9}
.r2-editor-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px;
  background:#192331;padding:12px 16px;margin:0;border-bottom:1px solid #394456}
.r2-editor-actions .r2-button,.r2-editor-actions .draft-actions button{
  min-height:38px;padding:8px 11px;border:1px solid #4a5970;border-radius:3px;
  font-size:13px;font-weight:650;line-height:1.35;background:#283345;color:#e7eff9;
  text-decoration:none;white-space:normal}
.r2-editor-actions .r2-button:hover,.r2-editor-actions .draft-actions button:hover{
  background:#35455c;color:#fff;border-color:#8291a5}
.r2-editor-actions #r2-run{background:#a995ed;color:#20182e;border-color:#a995ed;
  padding:8px 18px}
.r2-editor-actions #r2-run:hover{background:#d0c2fc;border-color:#d0c2fc}
.r2-editor-actions button:disabled{opacity:.6}
.r2-editor-actions #r2-exports{border-color:transparent;background:transparent;color:#c7b8f9}
.r2-editor .draft-actions{display:contents;margin:0;padding:0}
.r2-editor .draft-actions #reset-draft{background:transparent;color:#b8c5d4}
.r2-editor .draft-title{display:none}
.r2-editor-well{display:grid;grid-template-columns:52px minmax(0,1fr);
  min-width:0;background:#101722;border-bottom:1px solid #394456}
.r2-line-numbers{height:100%;min-height:420px;padding:19px 10px 22px 4px;
  background:#151e2b;color:#72829b;overflow:hidden;white-space:pre;
  font:14px/1.7 "Cascadia Code",Consolas,monospace;text-align:right;
  user-select:none;pointer-events:none;border-right:1px solid #344258}
.r2-editor .scratch-editor{width:100%;height:clamp(420px,47dvh,560px);min-height:420px;
  display:block;border:0;border-radius:0;outline-offset:-3px;background:#101722;
  color:#e9eef7;padding:19px 18px 22px;font:14px/1.7 "Cascadia Code",Consolas,monospace;
  tab-size:4;resize:vertical;white-space:pre;overflow:auto}
.r2-editor-foot{display:flex;align-items:center;justify-content:space-between;
  flex-wrap:wrap;gap:8px;padding:7px 15px;background:#1e2938;color:#c7d1e0;
  font:12px/1.5 "Cascadia Code",Consolas,monospace}
.r2-terminal{background:#0c121b;color:#e5edf8;border-top:1px solid #384459;
  min-width:0}
.r2-terminal-head{display:flex;align-items:center;justify-content:space-between;
  gap:12px;border-bottom:1px solid #344154;background:#182130;
  padding:11px 16px;font:650 14px/1.4 "Cascadia Code",Consolas,monospace}
.r2-terminal-clear{min-height:34px;padding:5px 11px;border:1px solid #516077;
  border-radius:2px;background:transparent;color:#d1ddeb;font-size:13px}
.r2-terminal #local-runner-status{font-size:14px;line-height:1.6;color:#b8c9dd;
  margin:11px 16px}
.r2-terminal .local-runner-console{min-height:112px;margin:0;padding:12px 16px 18px;
  background:#0c121b;color:#dbe9fb;border:0;border-radius:0;max-width:100%;
  overflow:auto;font:14px/1.65 "Cascadia Code",Consolas,monospace;white-space:pre-wrap}
.r2-terminal #local-runner-images{padding:0 16px 16px;max-width:100%}
/* Original Julia Test controls now live with the real editor and terminal. */
.r2-test-desk{min-width:0;scroll-margin-top:145px;background:#131d2b;
  border-top:1px solid #45516a;color:#e7eefa}
.r2-test-desk[hidden]{display:none}
.r2-test-desk>summary{display:flex;align-items:center;justify-content:space-between;
  gap:12px;min-height:53px;padding:13px 18px;cursor:pointer;list-style:none;
  font-size:15px;background:#202d3e;color:#f2f3ff}
.r2-test-desk>summary::-webkit-details-marker{display:none}
.r2-test-desk>summary:focus-visible{outline:2px solid #ad9dee;outline-offset:-3px}
.r2-test-desk-summary strong{font-size:16px}
#r2-test-case-count{font-size:14px;font-weight:550;color:#c9d7e9}
.r2-test-desk #external-tests{min-width:0;padding:0;margin:0;border:0;
  color:#e6edf8;background:#141e2b}
.r2-test-panes{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);
  min-width:0;border-top:1px solid #43526a}
.r2-test-cases-pane,.r2-test-results-pane{min-width:0;padding:19px 18px}
.r2-test-results-pane{border-left:1px solid #43526a;background:#0f1722}
.r2-test-cases-pane #external-test-heading{font-size:18px;letter-spacing:-.02em;
  margin:0 0 18px;line-height:1.5;color:#f2f4fb}
.r2-test-cases-pane #external-test-cases{list-style:decimal-leading-zero;
  padding-left:36px;overflow-wrap:anywhere;margin:0 0 19px}
.r2-test-cases-pane #external-test-cases li{padding:10px 8px;
  border-bottom:1px solid #364459;font-size:14px;line-height:1.65}
.r2-test-cases-pane #external-test-cases li::marker{color:#b49df4;
  font-family:"Cascadia Code",Consolas,monospace;font-weight:700}
.r2-test-desk .external-test-actions{display:flex;flex-wrap:wrap;gap:8px;
  margin:13px 0}
.r2-test-desk .external-test-actions button,.r2-test-desk #external-report-inspect,
.r2-test-desk #property-lab button{border:1px solid #637389;color:#eef4fd;
  background:#2a394e;border-radius:3px;min-height:41px;padding:9px 12px;
  font-size:14px;font-weight:650;width:auto}
.r2-test-desk .external-test-actions button:hover,
.r2-test-desk #external-report-inspect:hover{background:#3a506c}
.r2-test-desk .external-test-actions button:disabled{opacity:.55;cursor:not-allowed}
.r2-test-desk #external-test-local-run{background:#a797ed;color:#1e1634;
  border-color:#a797ed}
.r2-test-desk #external-test-local-run:hover{background:#cec0fd}
.r2-test-desk #external-test-details{border-top:1px solid #364459;padding-top:10px}
.r2-test-desk #external-test-details summary,
.r2-test-desk #external-focus-details summary,
.r2-test-desk #external-report-details summary{color:#ddcffd;font-size:14px;
  padding:7px 0;cursor:pointer}
.r2-test-desk .code{background:#0b131e;color:#dce9fc;border:1px solid #34435a;
  border-radius:2px;max-width:100%;box-sizing:border-box;font:13px/1.7 "Cascadia Code",Consolas,monospace;
  white-space:pre;overflow:auto}
.r2-test-results-head{display:flex;flex-direction:column;gap:8px;
  border-bottom:1px solid #39485e;padding:0 0 14px;margin-bottom:13px}
.r2-test-results-head>span:first-child{font-size:16px;font-weight:720;color:#fff}
#r2-test-verification{font-size:14px;line-height:1.5;color:#d2c6f7;
  white-space:pre-wrap;overflow-wrap:anywhere}
.r2-test-results-pane .external-test-run,.r2-test-results-pane .feedback{
  font-size:14px!important;line-height:1.65;color:#c6d2e4;overflow-wrap:anywhere}
.r2-test-results-pane #external-test-local-status{margin:14px 0;
  color:#d7c8ff;font-weight:600}
.r2-test-results-pane .local-runner-console{padding:15px;margin:12px 0;
  max-height:320px;min-height:90px;border:1px solid #39475c;border-radius:2px;
  color:#e4effc;background:#0b111b;font:14px/1.65 "Cascadia Code",Consolas,monospace;
  white-space:pre-wrap;overflow:auto;overflow-wrap:anywhere}
.r2-test-desk .external-focus,.r2-test-desk .algorithm-design,
.r2-test-desk .property-lab,.r2-test-desk #external-report-details{
  border-top:1px solid #3f5068;margin:0;padding:18px;min-width:0}
.r2-test-desk .external-focus label,
.r2-test-desk .algorithm-design h3,.r2-test-desk .property-lab h3{
  font-size:16px;line-height:1.5;color:#f2f4fc;font-weight:700}
.r2-test-desk .external-focus select,.r2-test-desk #property-choice,
.r2-test-desk #external-report-input{width:min(100%,550px);max-width:100%;
  box-sizing:border-box;min-height:42px;padding:10px 12px;
  color:#111827;background:#f9fbff;border:1px solid #93a0b5;border-radius:3px;
  font-size:15px}
.r2-test-desk #external-focus-local-status{font-size:14px;
  line-height:1.6;color:#d7c8ff;font-weight:600}
.r2-test-desk .external-focus>.local-runner-console{
  min-height:80px;max-height:280px;max-width:100%;box-sizing:border-box;
  overflow:auto;overflow-wrap:anywhere;white-space:pre-wrap;
  padding:15px;background:#0b131f;border:1px solid #42516a;
  color:#deebfc;font:14px/1.65 "Cascadia Code",Consolas,monospace}
.r2-test-desk .external-focus-instruction,.r2-test-desk .feedback,
.r2-test-desk .algorithm-design p,.r2-test-desk .property-lab p,
.r2-test-desk #external-report-results{font-size:14px!important;line-height:1.65;
  color:#c7d4e7;overflow-wrap:anywhere}
.r2-test-desk #external-report-results strong{color:#e9e8ff}
.r2-test-desk .algorithm-contract{display:flex;gap:16px;flex-wrap:wrap}
.r2-test-desk .algorithm-contract div{min-width:0}
.r2-test-desk .algorithm-contract dt{font-size:14px;color:#c8d3e5}
.r2-test-desk .algorithm-contract dd{font-size:15px;color:#eff2ff}
.r2-runner-diagnostics{margin:0 17px 18px;padding:15px 0 0;
  border-top:1px solid #41506a}
.r2-runner-diagnostics h3{font-size:15px;color:#f0efff;line-height:1.5;
  margin:0 0 12px}
.r2-runner-diagnostics .feedback{font-size:14px;color:#d2dded;
  line-height:1.65}
.r2-runner-diagnostics .local-runner-console{max-height:260px;background:#0d1621;
  color:#e1ecfa;border:1px solid #43516b;overflow:auto;white-space:pre-wrap;
  overflow-wrap:anywhere;font:13px/1.6 "Cascadia Code",Consolas,monospace}
.r2-runner-setup{margin:0;border-top:1px solid #394456;background:#1b2534;padding:0}
.r2-runner-setup>summary{padding:14px 17px;color:#e7ecf8;
  cursor:pointer;font-size:14px;font-weight:700}
.r2-runner-setup>.local-runner{padding:8px 17px 19px;margin:0;border:0;background:transparent}
.r2-runner-setup .local-runner h3{font-size:16px;color:#eef2f9}
.r2-runner-setup .local-runner p,.r2-runner-setup .local-runner label{
  color:#c2cede;font-size:14px}
.r2-runner-setup #local-runner-token{color:#171d24;background:#fff;border:1px solid #76849b}
.r2-runner-setup .local-runner-actions{display:flex;flex-wrap:wrap;gap:9px}
.r2-runner-setup .local-runner-actions button{min-height:40px}
.r2-runner-setup .local-runner-console{color:#dee8f7;background:#111823;
  border:1px solid #394456;min-height:35px;max-width:100%}
.r2-editor>.compiler{position:relative;top:auto;max-height:none;overflow:visible;
  width:auto;padding:0 16px 22px;border:0;background:#1b2534;
  box-shadow:none;border-top:1px solid #394456}
.r2-editor>.compiler .compiler-heading{display:flex;align-items:center;
  justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 10px}
.r2-editor>.compiler .compiler-heading h2{font-size:16px;line-height:1.4;
  color:#edf1fa;letter-spacing:-.02em;margin:0}
.r2-editor>.compiler .compiler-heading .eyebrow{font-size:12px;color:#b7c4d8}
.r2-editor>.compiler .runtime-tag{color:#c9d7eb;background:#253347;
  border:1px solid #50617a;font-size:12px}
.r2-editor>.compiler .compiler-explainer,.r2-editor>.compiler .privacy-note{
  color:#c2ccdb;font-size:14px}
.r2-editor>.compiler .local-runner-console{background:#111823;color:#e3e9f0;
  border:0;border-radius:2px;min-height:58px;max-width:100%;font-size:13px}
.r2-compiler-extras{margin-top:8px;border-top:1px solid #394456;padding:13px 0}
.r2-compiler-extras>summary{font-size:14px;font-weight:650;color:#c7b8f9}
.r2-page-heading{margin:10px 0 32px}
.r2-page-heading h1{font-size:clamp(31px,3.5vw,47px);line-height:1.15;
  letter-spacing:-.048em;margin:0 0 10px}
.r2-page-heading h2{font-size:27px;letter-spacing:-.035em;margin:0 0 8px}
.r2-page-heading p{max-width:66ch;color:var(--muted);margin:0}
/* Explore keeps the authored numerical controls intact while exposing their live Julia source. */
.r2-explore{max-width:1330px;margin:0 auto;min-width:0}
.r2-explore>.r2-inner-head{margin:4px 0 17px}
.r2-explore .r2-lab-bar{margin:0 0 21px;border-bottom:1px solid var(--line);
  padding-bottom:15px;display:grid;gap:13px}
.r2-explore .r2-lab-picker{display:flex;align-items:center;gap:15px;
  padding:0;margin:0;background:transparent;border:0}
.r2-lab-picker label{font-weight:700;font-size:15px;white-space:nowrap;color:var(--ink)}
.r2-lab-picker select{flex:1;min-width:0;max-width:760px;min-height:44px;
  padding:9px 12px;border:1px solid #b8c1cf;border-radius:3px;
  color:var(--ink);background:var(--surface);font-size:15px}
.r2-lab-shortcuts{display:flex;gap:7px;flex-wrap:wrap}
.r2-lab-shortcuts button{border:1px solid var(--line);background:var(--surface);
  min-height:39px;padding:8px 12px;border-radius:3px;color:var(--ink);
  font-size:14px;font-weight:650;line-height:1.4}
.r2-lab-shortcuts button[aria-current="true"]{border-color:var(--accent);
  background:var(--accent-soft);color:var(--accent)}
.r2-lab-shortcuts button:hover{border-color:var(--accent)}
.r2-explore-workbench{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(285px,.86fr);
  gap:0;min-width:0;align-items:start;border:1px solid var(--line);
  background:var(--surface);scroll-margin-top:calc(var(--r2-header) + 12px)}
.r2-explore-stage{min-width:0;background:var(--surface)}
.r2-explore-stage>.r2-lab:not(.r2-lab-inactive){padding:clamp(18px,2.6vw,33px);
  margin:0;background:transparent;border:0;width:100%;max-width:none;min-width:0;
  box-shadow:none;overflow:visible}
.r2-explore-stage>.r2-lab h2{font-size:clamp(20px,2vw,26px);
  letter-spacing:-.035em;line-height:1.33}
.r2-explore .numerical-layout,.r2-explore .factor-matrices,
.r2-explore .fitting-layout{max-width:100%;min-width:0}
.r2-explore svg{display:block;max-width:100%;height:auto}
.r2-explore .numerical-controls,.r2-explore .elim-controls,
.r2-explore .precision-controls,.r2-explore .fit-controls,
.r2-explore .factor-controls,.r2-explore .sensitivity-controls{max-width:100%;min-width:0}
.r2-explore .elim-matrix-scroll,.r2-explore .precision-table-scroll,
.r2-explore .fit-data-scroll,.r2-explore .sensitivity-table-scroll,
.r2-explore .numerical-values{max-width:100%;overflow-x:auto}
.r2-explore-source{position:sticky;top:calc(var(--r2-header) + 16px);
  display:flex;flex-direction:column;min-width:0;max-height:calc(100dvh - var(--r2-header) - 30px);
  overflow:auto;background:#131a26;border-left:1px solid #364257;color:#e9eef7}
.r2-explore-source-head{padding:16px 18px;background:#202b3b;
  border-bottom:1px solid #37455c;display:flex;flex-wrap:wrap;
  gap:6px 13px;align-items:baseline;justify-content:space-between}
.r2-explore-source-head strong{font-size:15px;color:#fff;font-weight:720}
#r2-explore-source-state{font-size:14px;line-height:1.55;color:#c6d1e2}
#r2-explore-source-content{min-width:0;padding:16px 18px;flex:1}
.r2-explore-source details{min-width:0;border:0;margin:0;padding:0}
.r2-explore-source details>summary{font-size:15px;line-height:1.5;font-weight:700;
  color:#eee9ff;min-height:40px;cursor:pointer;padding:9px 0}
.r2-explore-source pre.code,.r2-explore-source .practice-code,
.r2-explore-source .r2-explore-live-source{box-sizing:border-box;
  width:100%;max-width:100%;min-width:0;max-height:47dvh;overflow:auto;
  padding:15px;border:1px solid #43506b;background:#0e1520;
  color:#e2edff;border-radius:2px;white-space:pre;tab-size:4;
  font:13px/1.75 "Cascadia Code",Consolas,monospace}
.r2-explore-source button{min-height:41px;padding:9px 13px;border-radius:3px;
  border:1px solid #697997;background:#2e3d56;color:#eff3ff;
  font-size:14px;font-weight:650;max-width:100%}
.r2-explore-source button:hover{background:#465a78}
.r2-explore-source .feedback,.r2-explore-copy-state{
  display:block;margin-top:12px;font-size:14px;line-height:1.6;color:#d4dff1}
.r2-explore-source-actions{padding:15px 18px;border-top:1px solid #37455c}
.r2-explore-source-actions button{width:100%;background:#a996ed;color:#20182e;
  border-color:#a996ed}
.r2-explore-source-actions button:hover{background:#cdbdfb;color:#20182e}
.r2-no-source{font-size:15px;line-height:1.7;color:#d0dbeb;margin:0}
.r2-explore-workbench[data-has-source="false"]{grid-template-columns:minmax(0,1fr)}
.r2-explore-workbench[data-has-source="false"] .r2-explore-source{
  position:static;max-height:none;border-left:0;border-top:1px solid #37455c}
.r2-explore-workbench[data-has-source="false"] .r2-explore-source-head{padding:12px 18px}
.r2-explore-workbench[data-has-source="false"] #r2-explore-source-content{padding:14px 18px}
.r2-explore-workbench[data-has-source="false"] .r2-explore-source-actions{padding:12px 18px}
@media(max-width:1070px){
  .r2-explore-workbench{grid-template-columns:minmax(0,1fr)}
  .r2-explore-source{position:static;max-height:none;border-left:0;border-top:1px solid #37455c}
  .r2-explore-source pre.code{max-height:340px}
}
.r2-mixed{max-width:950px}
.r2-mixed #semester-rehearsal{background:var(--surface);border:1px solid var(--line);
  padding:clamp(19px,3vw,40px);margin:0}
.r2-mixed #semester-rehearsal>summary{display:none}
.r2-mixed .rehearsal-item{border:0;padding:10px 0}
.r2-mixed .rehearsal-title{font-size:25px;letter-spacing:-.025em}
.r2-mixed .rehearsal-question{font-size:17px}
.r2-mixed .rehearsal-working{font-size:16px;min-height:165px}
.r2-mixed-navigation{display:flex;align-items:center;justify-content:space-between;
  padding:22px 0;gap:12px}
.r2-mixed-navigation span{font-size:14px;color:var(--muted)}
.r2-utilities{max-width:970px}
.r2-utilities>details,.r2-utilities>#settings-panel{display:block;max-width:none;
  padding:24px;margin:0 0 18px;background:var(--surface);border:1px solid var(--line)}
.r2-utilities>details summary{font-size:17px;font-weight:700;cursor:pointer}
.r2-utilities #settings-panel{position:static;max-height:none}
.r2-utilities .privacy-note{color:var(--muted);font-size:13px}
#r2-stage-code .privacy-note,#r2-stage-code .compiler-explainer{font-size:13px}
.lesson-footer{max-width:1280px;margin:44px auto 0;border-top:1px solid var(--line)}
.r2-mobile-action{display:none}
@media(max-width:900px){
  .r2-learn .r2-learn-paper,.r2-check-layout{grid-template-columns:minmax(0,1fr)}
  .r2-example-pane,.r2-check-reference{border-left:0;border-top:1px solid #344154}
  .r2-check-reference-code{max-height:280px}
  .r2-course-layout{grid-template-columns:minmax(0,1fr);gap:24px}
  .r2-next-lesson{position:static}
  .r2-code-layout{display:flex;flex-direction:column;min-height:0}
  .r2-instructions{order:-1;position:static;top:auto;max-height:none;width:100%;
    border-left:0;border-bottom:1px solid var(--line);overflow:visible}
  .r2-instructions>summary{position:static}
  .r2-editor{width:100%;padding:0}
  .r2-lesson-picker{position:static;order:1;margin-top:12px;max-width:none}
  .r2-lesson-picker select{width:min(80vw,350px)}
}
@media(max-width:767px){
  :root{--r2-header:56px}
  body{padding-bottom:calc(68px + env(safe-area-inset-bottom))}
  .topbar{padding:0 12px;height:var(--r2-header)}
  .brand-mark{width:34px;height:34px;font-size:25px}
  .brand strong{font-size:15px}
  .brand small{display:none}
  .top-right #offline-indicator{font-size:12px}
  .r2-global-nav{gap:0}
  .r2-global-nav button{font-size:12px;min-height:42px;padding:8px 9px}
  .r2-page{padding:23px 16px 110px}
  .r2-course-hero{padding:7px 0 24px}
  .r2-course-identity{font-size:12px;gap:9px}
  .r2-course-hero-main{display:block;margin-top:17px}
  .r2-course-hero h1{font-size:clamp(28px,7.5vw,36px)}
  .r2-course-hero p{font-size:14px}
  .r2-course-hero-actions{display:flex;flex-wrap:wrap;align-items:center;
    justify-content:space-between;justify-items:start;margin-top:19px}
  .r2-course-progress{font-size:12px;text-align:left}
  .r2-course-layout{gap:22px;margin-top:21px;display:flex;flex-direction:column}
  .r2-course-path,.r2-next-lesson{width:100%}
  .r2-course-heading{margin:0 0 14px}
  .r2-course-heading h2{font-size:22px}
  .r2-course-list .lesson-link{gap:9px}
  .r2-course-list .nav-score{font-size:12px;min-width:62px;max-width:78px}
  .r2-group-progress{font-size:13px}
  .r2-syllabus-details{font-size:13px}
  .r2-preview-prereqs,.r2-preview-checkpoint{margin-left:18px;margin-right:18px}
  .r2-preview-actions{width:100%}
  .r2-preview-actions .r2-button{flex:1 1 auto}
  .r2-lesson-path{gap:11px;margin-top:10px;padding-top:13px}
  .r2-lesson-path-actions{width:100%;gap:8px;margin-left:0}
  #r2-lesson-checkpoint{flex:1 1 100%;margin-right:0}
  .r2-lesson-path-actions button{flex:1 1 0;min-width:0}
  .r2-course-list .nav-group h3{padding:19px 9px 9px}
  .r2-course-list .lesson-link{min-height:52px;padding:10px 9px;font-size:14px}
  .r2-next-lesson .r2-preview-lesson{font-size:23px}
  .r2-preview-code{font-size:13px;padding:18px}
  .r2-preview-footer{padding:15px 18px}
  main#lesson-main{padding:17px 13px 95px}
  .r2-lesson-head{padding:9px 4px 15px}
  .r2-breadcrumb{font-size:12px;margin-bottom:4px}
  .r2-lesson-head .lesson-meta{font-size:12px;display:flex;flex-wrap:wrap;gap:8px}
  .r2-lesson-head h1{font-size:clamp(26px,7.4vw,32px);margin:5px 0}
  .r2-lesson-head .lead{font-size:14px}
  .r2-lesson-picker{width:100%;margin:9px 0}
  .r2-lesson-picker select{width:100%}
  .r2-stage-tabs{top:var(--r2-header);padding:0;
    min-height:48px;margin:0 0 17px;display:grid;grid-template-columns:repeat(4,1fr)}
  .r2-stage-tabs button{min-width:0;min-height:48px;white-space:nowrap;
    padding:11px 0;font-size:11px}
  .r2-stage-tabs button span{font-size:13px;margin:0 0 0 2px}
  .r2-activity{min-height:calc(100dvh - 320px)}
  .r2-learn .r2-learn-paper,.r2-check-layout{border:0}
  .r2-learn-reading{padding:24px 18px}
  .r2-learn #lesson-theory{font-size:17px;line-height:1.8}
  .r2-example-head{padding:14px 16px}
  .r2-example-pane pre.code{font-size:14px;padding:19px 16px;min-height:170px}
  .r2-example-actions{padding:15px 16px}
  .r2-check .r2-check-paper{padding:21px 17px}
  .r2-check .choice{min-height:54px;font-size:15px}
  .r2-check .question h3{font-size:21px}
  .r2-check-reference-code{font-size:13px;padding:18px 16px;max-height:230px}
  .r2-check-reference-actions{padding:15px 16px}
  .r2-question-tools{margin-top:5px}
  .r2-stage-footer{align-items:stretch}
  .r2-stage-footer .r2-button{min-width:0}
  .r2-stage-footer{margin:20px 0 0;gap:12px}
  .r2-code-layout{border:1px solid var(--line);background:transparent}
  .r2-instructions{padding:0;background:var(--surface);border:0;
    border-bottom:1px solid var(--line)}
  .r2-instructions #challenge-text{font-size:16px}
  .r2-editor{display:flex;flex-direction:column;padding:0;background:#121923;border:0}
  .r2-editor-head{order:0;padding:0 13px;min-height:48px}
  .r2-editor-well{order:1}
  .r2-editor-foot{order:2}
  .r2-editor-actions{order:3;display:flex;padding:10px;gap:7px}
  .r2-terminal{order:4}
  .r2-test-desk{order:5}
  .r2-test-panes{display:block}
  .r2-test-cases-pane,.r2-test-results-pane{padding:16px 13px}
  .r2-test-results-pane{border-left:0;border-top:1px solid #43526a}
  .r2-test-desk .external-test-actions button{flex:1 1 auto}
  .r2-runner-setup{order:6}
  .r2-editor>.compiler{order:7}
  .r2-editor-actions .r2-button,.r2-editor-actions .draft-actions button{
    flex:0 1 auto;font-size:13px;min-height:40px;padding:8px 10px}
  .r2-editor-well{grid-template-columns:42px minmax(0,1fr)}
  .r2-line-numbers{min-height:clamp(290px,43dvh,470px);font-size:13px;
    padding:15px 7px 16px 2px}
  .r2-editor .scratch-editor{height:clamp(290px,43dvh,470px);
    min-height:clamp(290px,43dvh,470px);font-size:14px;padding:15px 11px}
  .r2-terminal .local-runner-console{font-size:13px}
  .r2-runner-setup .local-runner-actions{margin-bottom:12px}
  .r2-runner-setup #local-runner-run{display:none}
  .r2-explore .r2-lab-picker{display:block}
  .r2-lab-picker label{display:block;margin-bottom:7px}
  .r2-lab-picker select{width:100%;max-width:none}
  .r2-lab-shortcuts{gap:6px}
  .r2-lab-shortcuts button{font-size:13px;min-height:42px;padding:9px 10px}
  .r2-explore-stage>.r2-lab:not(.r2-lab-inactive){padding:18px 13px}
  .r2-explore-source-head,#r2-explore-source-content,
  .r2-explore-source-actions{padding-left:13px;padding-right:13px}
  .r2-explore-source pre.code{font-size:12px;max-height:300px}
  .r2-mixed-navigation{gap:6px}
  .r2-mixed-navigation .r2-button{padding:10px}
  /* The footer's empty padding must not swallow clicks on lesson controls
     visible beneath it. Only the actual primary action owns pointer events. */
  .r2-mobile-action{display:flex;position:fixed;z-index:80;bottom:0;left:0;
    right:0;min-height:64px;padding:10px 16px calc(10px + env(safe-area-inset-bottom));
    background:var(--surface);border-top:1px solid var(--line);
    pointer-events:none}
  .r2-mobile-action button{width:100%;min-height:46px;font-size:15px;
    pointer-events:auto}
  html{scroll-padding-bottom:calc(100px + env(safe-area-inset-bottom))}
  .r2-instructions button,.r2-test-desk button,
  .r2-instructions input,.r2-instructions textarea,.r2-instructions select{
    scroll-margin-bottom:calc(100px + env(safe-area-inset-bottom))}
  .lesson-footer{padding-bottom:40px}
}
@media(max-width:365px){
  .r2-global-nav button{font-size:11px;padding:7px 6px}
  .r2-stage-tabs button{font-size:10px}
  .r2-stage-tabs button span{font-size:12px}
  .r2-mixed-navigation span{font-size:12px}
  .r2-lesson-head .lead{font-size:14px}
}
@media(prefers-color-scheme:dark){
  :root{
    --canvas:#111317;--surface:#1b1e23;--surface-muted:#23272d;
    --ink:#f1f2f4;--muted:#aeb5c0;--line:#353b44;--accent:#b5a2ff;
    --accent-soft:#2e2845;--success:#6ec9a5;--warning:#f1be72;
    --error:#f19aa1;--deep:#f1f2f4;--washed:#23272d;--active:#2e2845;
    --code-bg:#0d1015;color-scheme:dark;
  }
  .r2-primary,.primary{color:#15121f;background:#b5a2ff;border-color:#b5a2ff}
  .r2-primary:hover,.primary:hover{background:#cabaff;border-color:#cabaff;color:#15121f}
  .r2-secondary,.secondary{color:var(--ink);background:var(--surface);border-color:#525764}
  .r2-global-nav button{color:var(--muted)}
  .r2-course-hero h1{color:var(--ink)}
  .r2-course-list .lesson-link{border-bottom-color:var(--line)}
  .r2-learn .code,.r2-instructions .code{background:var(--code-bg)}
  .r2-editor .scratch-editor{background:var(--code-bg);color:#f0eff6}
  .r2-check .choice.selected{background:var(--accent-soft)}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}}
@media print{.r2-global-nav,.r2-stage-tabs,.r2-mobile-action,.r2-lesson-picker,
  .r2-code-layout,.r2-course,.r2-mixed,.r2-utilities{display:none!important}
  body{padding:0;background:#fff}}


/* R2 responsive reflow: shrink the lesson-picker's flex intrinsic width and
   contain code/math content inside its local scrolling surface. */
@media(max-width:767px){
  .r2-lesson-head,.r2-stage-content,.r2-activity,.r2-learn .paper,
  .r2-code-layout,.r2-instructions,.r2-editor{
    min-width:0;max-width:100%;box-sizing:border-box}
  .r2-lesson-picker{display:grid;grid-template-columns:auto minmax(0,1fr);
    gap:10px;width:100%;max-width:100%;min-width:0;box-sizing:border-box}
  .r2-lesson-picker select{width:100%;min-width:0;max-width:100%}
  .r2-lesson-head .lesson-meta>*{min-width:0;overflow-wrap:anywhere}
  .r2-lesson-head h1{overflow-wrap:break-word}
  .r2-learn pre.code,.r2-instructions pre.code{min-width:0;max-width:100%;overflow-x:auto}
}

/* The worked Julia example belongs next to the mathematical explanation
   at widths where both remain legible. Small screens retain linear reading. */
.r2-mobile-action.r2-keyboard-visible{display:none!important}


/* Existing lesson task summary remains collapsible on mobile; editor stays first. */
.brand-mark{position:relative;overflow:hidden}
.brand-mark span{position:static!important;display:inline!important}
.r2-instructions>summary{display:flex}
.r2-editor-actions{margin:0 0 20px}
.r2-editor .draft-actions{margin:14px 0}
@media(max-width:767px){
  .r2-instructions{border:0;border-bottom:1px solid var(--line);background:var(--surface);padding:0}
  .r2-instructions>summary{display:grid;gap:5px;cursor:pointer;padding:14px 16px;list-style:none}
  .r2-instructions>summary::-webkit-details-marker{display:none}
  .r2-instructions>summary:after{content:"Read full task & starter →";font-size:12px;
    font-weight:700;color:var(--accent)}
  .r2-instructions[open]>summary:after{content:"Hide task details ↑"}
  .r2-task-summary strong{font-size:14px;color:var(--ink)}
  #r2-task-summary-text{font-size:14px;line-height:1.4;color:var(--muted);
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .r2-instructions>.paper{padding:0 16px 18px}
  .r2-code-layout{gap:0}
  .r2-editor{border-top:1px solid var(--line);padding:15px 14px}
  .r2-editor-head{padding:2px 0 11px;margin-bottom:12px}
  .r2-editor .scratch-editor{min-height:clamp(280px,42dvh,460px)}
}


/* Phase 09 — touch-only editing keys for the canonical Julia textarea.
   Horizontal scrolling stays inside the key row; no extra editor or storage. */
.r2-touch-keys{display:none}
@media(max-width:1024px){
  .r2-touch-keys{display:flex;align-items:center;gap:7px;padding:10px 13px;
    min-width:0;max-width:100%;box-sizing:border-box;overflow-x:auto;
    overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;
    background:#1b2636;border-block:1px solid #394456}
  .r2-touch-key{flex:0 0 auto;min-width:46px;min-height:44px;padding:9px 12px;
    border:1px solid #66758b;border-radius:4px;background:#29384b;
    color:#f2f6fc;font:600 15px/1.3 "Cascadia Code",Consolas,monospace;
    touch-action:manipulation}
  .r2-touch-key:hover,.r2-touch-key:focus-visible{background:#415573;border-color:#b2c8e8}
}
@media(max-width:767px){
  .r2-editor .r2-touch-keys{order:1}
  .r2-editor .r2-editor-well{order:2}
  .r2-editor .r2-editor-foot{order:3}
  .r2-editor .r2-editor-actions{order:4}
  .r2-editor .r2-terminal{order:5}
  .r2-editor .r2-test-desk{order:6}
  .r2-editor .r2-runner-setup{order:7}
}

/* Phase 07 — source-owned coding practice navigation. */
.r2-practice-path{margin:0 0 1rem;padding:1rem 1.15rem;border:1px solid var(--border,#cbd5e1);border-radius:12px;background:var(--surface,#fff)}
.r2-practice-path header h2{font-size:1.05rem;margin:0 0 .3rem}
.r2-practice-path header p{margin:0 0 .9rem;font-size:.9rem;opacity:.8}
.r2-practice-choices{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.45rem}
.r2-practice-choices button{font:inherit;font-size:.84rem;text-align:left;padding:.7rem;border:1px solid currentColor;border-radius:7px;background:transparent;color:inherit;cursor:pointer;overflow-wrap:anywhere}
.r2-practice-choices button[aria-pressed="true"]{outline:2px solid currentColor;outline-offset:-3px;font-weight:700}
.r2-practice-choices button:disabled{opacity:.4;cursor:not-allowed}
.r2-practice-choices button:focus-visible{outline:3px solid #7c9cda;outline-offset:2px}
#r2-practice-guidance{font-size:.88rem;line-height:1.5;margin:.85rem 0 0}
@media(max-width:760px){.r2-practice-choices{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:350px){.r2-practice-path{padding:.75rem}.r2-practice-choices button{padding:.5rem;font-size:.78rem}}


.r2-scaffold{margin-top:.9rem;padding:.8rem;border-top:1px solid currentColor}
.r2-scaffold[hidden]{display:none}
#r2-scaffold-count{font-size:.85rem;font-weight:700}
#r2-scaffold-cue{white-space:pre-wrap;overflow-wrap:anywhere;font-size:.9rem;line-height:1.55}
.r2-scaffold button{font:inherit;font-size:.85rem;padding:.45rem .65rem;margin-right:.4rem;margin-bottom:.3rem;border:1px solid currentColor;border-radius:6px;color:inherit;background:transparent;cursor:pointer}
.r2-scaffold button:disabled{opacity:.4;cursor:not-allowed}
.r2-scaffold button:focus-visible{outline:3px solid #7c9cda;outline-offset:2px}

/* Phase 09: WebKit mobile G1/G2 overflow. This comes AFTER the original
   .r2-explore-stage>.r2-lab:not(.r2-lab-inactive){overflow:visible}
   rule and uses the canonical panel ID, so computed overflow is actually
   auto. The original source and any wider content stay accessible by
   scrolling inside the teaching panel, never by widening the page. */
@media(max-width:600px){
  #r2-stage-explore .r2-explore-stage>#completion-depth{
    max-width:100%;min-width:0;
    overflow-x:auto;overscroll-behavior-x:contain}
}


/* L1 learning-first shell: original numerical exercises and learner data remain intact. */
.r2-study-task{max-width:880px;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:clamp(16px,3vw,26px);margin:0 0 30px;min-width:0}
.r2-study-task h2{font-size:21px;margin:0 0 15px;line-height:1.3}
.r2-study-task label{display:block;font-size:14px;font-weight:650;margin-bottom:7px}
#r2-study-task-choice{max-width:360px;width:100%;min-height:43px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:5px;padding:8px 12px;font-size:14px}
#r2-study-task-prompt,#r2-study-success{font-size:15px;line-height:1.65;max-width:70ch}
.r2-study-code-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:14px}
.r2-study-code-heading button{border:1px solid var(--line);border-radius:5px;background:var(--surface);color:var(--ink);min-height:40px;padding:7px 12px;font-size:14px}
.r2-study-task pre{max-width:100%;overflow:auto;white-space:pre}
.r2-study-task details{padding:12px 0}
.r2-study-task details summary{font-size:14px;color:var(--ink)}
.r2-study-task li{font-size:14px;margin:8px 0}
#r2-study-copy-status{font-size:14px;color:var(--muted)}
.r2-reference-index{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0 0 28px}
.r2-reference-index h2{grid-column:1/-1;font-size:19px;margin:0 0 6px}
.r2-reference-index a{display:block;text-decoration:none;background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:11px 12px;font-size:14px}
.r2-reference-index a:hover{border-color:var(--accent);color:var(--accent)}
.r2-legacy-tools>summary,.r2-reference-submission>summary{color:var(--ink);font-size:15px}
.r2-legacy-tools>p{font-size:14px;color:var(--muted);max-width:65ch}
.r2-legacy-tools button{margin:8px 0 16px}
@media(max-width:550px){.r2-reference-index{grid-template-columns:1fr}.r2-study-task{padding:15px}.r2-study-task .code{font-size:12px}}


/* L2 source-verified worked examples: read and predict; no browser execution. */
.r2-worked-heading{display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;
  gap:10px;padding:15px 19px 4px;color:#e7edf8}
.r2-worked-heading h3{font-size:17px;line-height:1.35;margin:0;font-weight:700}
#r2-worked-count{font-size:14px;color:#bbc8dd}
.r2-worked-nav{display:flex;gap:9px;overflow-x:auto;padding:9px 19px 12px;scrollbar-width:thin}
.r2-worked-nav button{flex:0 0 auto;min-width:44px;min-height:43px;border-radius:5px;
  border:1px solid #62728d;background:#1e2938;color:#e7edf8;font-size:14px;font-weight:700}
.r2-worked-nav button[aria-pressed="true"]{border-color:#c5b6ff;background:#43376d;color:#fff}
.r2-worked-nav button:hover{border-color:#c5b6ff}
.r2-worked-title{padding:0 19px;margin:5px 0 0;font-size:17px;color:#e7edf8;line-height:1.4}
.r2-example-pane .r2-worked-output{margin:0;padding:16px 19px;
  border-top:1px solid #344154;border-bottom:1px solid #344154}
.r2-example-pane .r2-worked-output summary{color:#e7edf8;font-size:15px;font-weight:700;cursor:pointer}
.r2-example-pane .r2-worked-output pre{font:14px/1.7 "Cascadia Code",Consolas,monospace;
  white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%;color:#d5f7df;
  background:#17252b;border-radius:5px;padding:14px;margin:12px 0 0}
.r2-worked-explanation{padding:17px 19px;color:#e7edf8}
.r2-worked-explanation h4{font-size:16px;margin:3px 0 8px;font-weight:700}
.r2-worked-explanation p,.r2-worked-explanation li{font-size:15px;line-height:1.75;color:#d2def0}
.r2-worked-explanation p{margin:0 0 15px}
.r2-worked-explanation ol{padding-left:22px;margin:0 0 20px}
.r2-worked-explanation li{padding-left:3px;margin:0 0 8px}
.r2-worked-heading[hidden],.r2-worked-nav[hidden],.r2-worked-title[hidden],
.r2-example-pane .r2-worked-output[hidden],.r2-worked-explanation[hidden]{display:none!important}
@media(max-width:560px){.r2-worked-heading,.r2-worked-nav,.r2-worked-title{padding-left:16px;padding-right:16px}
  .r2-worked-explanation,.r2-example-pane .r2-worked-output{padding-left:16px;padding-right:16px}}


/* L3: authored practice questions remain distinct from canonical three-question progress. */
.r2-extra-quiz{max-width:1260px;margin:36px auto 24px;padding:clamp(18px,3vw,32px);
  border:1px solid var(--line);background:var(--surface);border-radius:8px;min-width:0}
.r2-extra-quiz[hidden]{display:none!important}
.r2-extra-quiz>h2{margin:0 0 8px;font-size:clamp(21px,2.4vw,28px);line-height:1.3}
.r2-extra-overview,.r2-extra-progress{font-size:15px;color:var(--muted);line-height:1.65;margin:0 0 12px}
.r2-extra-progress{font-weight:650;color:var(--ink);margin-bottom:16px}
.r2-extra-nav{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 18px}
.r2-extra-nav button{min-height:43px;min-width:45px;border:1px solid var(--line);
  background:var(--surface);color:var(--ink);font-size:14px;font-weight:700;border-radius:5px}
.r2-extra-nav button[aria-current="step"]{border-color:var(--accent);background:var(--accent-soft);
  box-shadow:inset 0 -3px var(--accent)}
.r2-extra-type{font-size:14px;font-weight:700;color:var(--muted);margin:0 0 8px}
.r2-extra-title{font-size:clamp(18px,2vw,23px);margin:0 0 16px;line-height:1.5}
.r2-extra-source{font:14px/1.7 "Cascadia Code",Consolas,monospace;
  background:#111923;color:#e5edff;border:1px solid #354257;padding:17px;
  border-radius:6px;margin:0 0 17px;overflow-x:auto;white-space:pre;max-width:100%}
.r2-extra-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:15px}
.r2-extra-choice{padding:13px 16px;min-height:50px;font-size:15px;line-height:1.5;
  color:var(--ink);text-align:left;white-space:normal;overflow-wrap:anywhere;
  border:1px solid var(--line);background:var(--surface);border-radius:5px}
.r2-extra-choice:hover{border-color:var(--accent)}
.r2-extra-choice[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft)}
.r2-extra-numeric{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:0 0 16px}
.r2-extra-numeric[hidden],.r2-extra-choices[hidden]{display:none!important}
.r2-extra-numeric label{font-size:15px;font-weight:650;flex-basis:100%}
.r2-extra-numeric input{max-width:230px;width:100%;min-height:45px;border:1px solid var(--line);
  border-radius:5px;padding:9px 12px;background:var(--surface);color:var(--ink);font-size:16px}
.r2-extra-numeric button,.r2-extra-footer button{min-height:44px;padding:9px 16px;border-radius:5px;
  background:var(--surface);color:var(--ink);border:1px solid var(--line);font-size:15px;font-weight:650}
.r2-extra-numeric button{background:var(--accent);color:#fff;border-color:var(--accent)}
.r2-extra-hint{margin:10px 0;padding:3px 0;font-size:15px;line-height:1.7}
.r2-extra-hint summary{min-height:43px;padding:9px 0;cursor:pointer;font-weight:600}
.r2-extra-feedback{font-size:15px;line-height:1.7;padding:13px 16px;margin:14px 0;
  border-left:3px solid var(--line);background:var(--surface-muted)}
.r2-extra-feedback:empty{display:none}
.r2-extra-feedback[data-status="correct"]{border-left-color:var(--success)}
.r2-extra-feedback[data-status="retry"],.r2-extra-feedback[data-status="invalid"]{border-left-color:var(--error)}
.r2-extra-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:15px}
.r2-extra-footer button:disabled{opacity:.5;cursor:default}
@media(max-width:580px){.r2-extra-quiz{margin:23px 0;padding:17px 15px}
  .r2-extra-choices{grid-template-columns:minmax(0,1fr)}}


/* L4 substantial fundamentals within the learning paper, independent of course MCQ grade. */
.r2-fundamentals{max-width:1260px;margin:26px auto 16px;padding:clamp(18px,2.8vw,34px);
 background:var(--surface);border:1px solid var(--line);border-radius:8px;min-width:0}
.r2-fundamentals h2{font-size:clamp(23px,2.4vw,30px);margin:0 0 20px}
.r2-fundamentals h3{font-size:clamp(20px,2vw,26px);margin:16px 0}
.r2-fundamentals h4{font-size:19px;margin:22px 0 13px}
.r2-fundamentals h5{font-size:17px;margin:13px 0;line-height:1.45}
.r2-fundamentals-picker{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.r2-fundamentals-picker label{font-size:15px;font-weight:700}
#r2-fundamentals-topic{font-size:15px;min-height:44px;max-width:100%;padding:7px 12px;
 color:var(--ink);border:1px solid var(--line);border-radius:5px;background:var(--surface)}
.r2-fundamentals-intro p{font-size:16px;line-height:1.8;margin:0 0 16px;max-width:80ch}
.r2-fundamentals-concepts{padding:18px 20px 18px 38px;margin:20px 0 0;
 background:var(--surface-muted);border-left:3px solid var(--accent)}
.r2-fundamentals-concepts li{font-size:15px;line-height:1.7;margin:4px 0}
.r2-fundamentals-worked,.r2-fundamentals-tested{margin-top:28px;border-top:1px solid var(--line);padding-top:14px}
.r2-fundamentals-example-nav{display:flex;gap:10px;flex-wrap:wrap}
.r2-fundamentals-example-nav button{font-size:14px;min-height:44px;padding:9px 15px;
 background:var(--surface);border:1px solid var(--line);border-radius:5px;color:var(--ink)}
.r2-fundamentals-example-nav button[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent);font-weight:700}
.r2-fundamentals-source{font:14px/1.8 "Cascadia Code",Consolas,monospace;
 background:#111923;color:#ecf0ff;padding:18px;border:1px solid #364359;
 border-radius:6px;max-width:100%;overflow-x:auto;white-space:pre;margin:14px 0}
.r2-fundamentals-output{font-size:15px;margin:14px 0}
.r2-fundamentals-output summary,.r2-fundamentals-hint summary{font-weight:700;cursor:pointer;min-height:44px;padding:10px 0}
.r2-fundamentals-output pre{font:14px/1.7 "Cascadia Code",Consolas,monospace;
 white-space:pre-wrap;overflow-wrap:anywhere;background:var(--surface-muted);
 padding:13px 16px;border-radius:5px}
.r2-fundamentals-steps{padding-left:23px;margin:18px 0}
.r2-fundamentals-steps li{font-size:15px;line-height:1.75;margin:0 0 9px}
#r2-fundamentals-why,#r2-fundamentals-trap{font-size:15px;line-height:1.75;margin:0 0 16px}
.r2-fundamentals-progress{font-size:15px;line-height:1.6;font-weight:650}
.r2-fundamentals-question{border-top:1px solid var(--line);padding:16px 0}
.r2-fundamentals-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}
.r2-fundamentals-option{border:1px solid var(--line);background:var(--surface);
 color:var(--ink);text-align:left;border-radius:5px;padding:12px 15px;
 font-size:15px;line-height:1.5;min-height:48px;overflow-wrap:anywhere}
.r2-fundamentals-option[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft)}
.r2-fundamentals-feedback{margin:12px 0;padding:12px 15px;font-size:15px;line-height:1.7;
 border-left:3px solid var(--line);background:var(--surface-muted)}
.r2-fundamentals-feedback:empty{display:none}
.r2-fundamentals-feedback[data-status="correct"]{border-left-color:var(--success)}
.r2-fundamentals-feedback[data-status="retry"]{border-left-color:var(--error)}
.r2-fundamentals-hint{font-size:15px;line-height:1.6;margin:5px 0}
@media(max-width:620px){.r2-fundamentals{padding:18px 15px;margin:20px 0}
 .r2-fundamentals-options{grid-template-columns:minmax(0,1fr)}}

/* L5 algorithmic extension uses the proven L4 learning-paper structure with unique IDs. */
#r2-algorithms-topic{font-size:15px;min-height:44px;max-width:100%;padding:7px 12px;
 color:var(--ink);border:1px solid var(--line);border-radius:5px;background:var(--surface)}
#r2-algorithms-why,#r2-algorithms-trap{font-size:15px;line-height:1.75;margin:0 0 16px}
#r2-algorithms .r2-fundamentals-concepts li{line-height:1.75;overflow-wrap:anywhere}


/* L6: prerequisite study guide from stored answer evidence (no new progress key). */
#r2-learning-paths{max-width:1260px;margin:27px auto;padding:clamp(18px,2.7vw,34px);
 border:1px solid var(--line);background:var(--surface);border-radius:8px}
#r2-learning-paths h2{font-size:clamp(23px,2.4vw,29px);margin:0 0 14px}
.r2-paths-basis{font-size:15px;line-height:1.7;max-width:78ch;color:var(--muted);margin:0 0 12px}
#r2-paths-summary{font-size:15px;line-height:1.6;font-weight:700;color:var(--ink)}
#r2-learning-paths h3{font-size:20px;margin:24px 0 13px}
#r2-learning-paths h4{font-size:16px;line-height:1.45;margin:0 0 8px}
.r2-paths-suggested{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.r2-paths-priority{min-width:0;border:1px solid var(--line);padding:16px;background:var(--surface-muted);border-radius:5px}
.r2-paths-priority p,.r2-paths-state,.r2-paths-prereqs,.r2-paths-prereq-note{
 font-size:14px;line-height:1.65;margin:6px 0;color:var(--muted);overflow-wrap:anywhere}
.r2-paths-prereq-note{color:var(--ink)}
.r2-paths-action{min-height:44px;border:1px solid var(--accent);color:var(--ink);font-size:14px;
 border-radius:5px;background:var(--accent-soft);padding:9px 14px;text-align:left;margin-top:10px}
.r2-paths-list{list-style:decimal;padding:0 0 0 22px;margin:0;
 display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.r2-paths-unit{padding:16px;min-width:0;border:1px solid var(--line);background:var(--surface);border-radius:5px}
.r2-paths-unit::marker{font-size:14px;color:var(--muted);font-weight:700}
.r2-paths-unit[data-evidence="review"]{border-left:3px solid var(--error)}
@media(max-width:850px){.r2-paths-suggested{grid-template-columns:1fr}.r2-paths-list{grid-template-columns:1fr}}
@media(max-width:620px){#r2-learning-paths{padding:18px 15px;margin:20px 0}}


/* L7 original multistep AMP cases; readable source and independent, accessible checks. */
#r2-assessments{max-width:1260px;margin:28px auto;padding:clamp(18px,2.8vw,34px);min-width:0;
 background:var(--surface);border:1px solid var(--line);border-radius:8px}
#r2-assessments h2{font-size:clamp(23px,2.4vw,30px);margin:0 0 14px}
#r2-assessments h3{font-size:21px;margin:25px 0 16px}
#r2-assessments h4{font-size:19px;margin:22px 0 14px}
#r2-assessments h5{font-size:16px;line-height:1.5;margin:0 0 12px}
.r2-assessment-scope,.r2-assessment-context p,#r2-assessments .r2-assessment-principle,
#r2-assessments .r2-assessment-progress{font-size:15px;line-height:1.7;max-width:82ch}
.r2-assessment-picker{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:18px 0}
.r2-assessment-picker label{font-size:15px;font-weight:700}
#r2-assessment-select{min-height:44px;max-width:100%;font-size:15px;
 background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:5px;padding:8px 12px}
.r2-assessment-principle{border-left:3px solid var(--accent);padding:12px 16px;background:var(--surface-muted)}
.r2-assessment-steps{display:grid;grid-template-columns:minmax(0,1fr);gap:18px}
.r2-assessment-question{padding:18px;min-width:0;border:1px solid var(--line);border-radius:6px}
.r2-assessment-code{font:14px/1.75 "Cascadia Code",Consolas,monospace;
 background:#111923;color:#ecf0ff;border:1px solid #364359;padding:16px;
 white-space:pre;overflow-x:auto;max-width:100%;border-radius:5px}
.r2-assessment-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:15px 0}
.r2-assessment-option{min-height:44px;font-size:15px;line-height:1.5;color:var(--ink);
 text-align:left;border:1px solid var(--line);background:var(--surface);border-radius:5px;
 padding:11px 14px;overflow-wrap:anywhere}
.r2-assessment-option[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft)}
.r2-assessment-hint{font-size:15px;line-height:1.65;margin:10px 0}
.r2-assessment-hint summary{font-weight:700;min-height:44px;padding:10px 0;cursor:pointer}
.r2-assessment-answer{padding:12px 15px;font-size:15px;line-height:1.7;
 border-left:3px solid var(--line);background:var(--surface-muted);white-space:pre-wrap;overflow-wrap:anywhere}
.r2-assessment-answer:empty{display:none}
.r2-assessment-answer[data-status="correct"]{border-left-color:var(--success)}
.r2-assessment-answer[data-status="retry"]{border-left-color:var(--error)}
#r2-assessment-remedy:not(:empty){border-top:2px solid var(--line);margin-top:28px;padding-top:15px}
#r2-assessment-remedy>p{font-size:15px;line-height:1.7}
.r2-assessment-remedy-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
@media(max-width:800px){.r2-assessment-remedy-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:620px){#r2-assessments{padding:18px 15px;margin:20px 0}
 .r2-assessment-question{padding:14px 10px}.r2-assessment-options{grid-template-columns:minmax(0,1fr)}}


/* L8 independent transfer: math-first questions with Julia-verified reference output. */
#r2-transfer{max-width:1260px;margin:28px auto;padding:clamp(18px,2.5vw,34px);min-width:0;
 border:1px solid var(--line);border-radius:8px;background:var(--surface)}
#r2-transfer h2{font-size:clamp(23px,2.5vw,30px);margin:0 0 14px}
#r2-transfer h3{font-size:21px;margin:24px 0 14px}
#r2-transfer h4{font-size:19px;margin:24px 0 14px}
#r2-transfer h5{font-size:16px;line-height:1.5;margin:0 0 12px}
.r2-transfer-overview,.r2-transfer-exposition p,.r2-transfer-assumption,
.r2-transfer-status{font-size:15px;line-height:1.75;max-width:83ch;overflow-wrap:anywhere}
.r2-transfer-assumption{padding:13px 16px;border-left:3px solid var(--accent);
 background:var(--surface-muted)}
.r2-transfer-picker{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin:20px 0}
.r2-transfer-picker label{font-size:15px;font-weight:700}
#r2-transfer-select{font-size:15px;min-height:44px;max-width:100%;background:var(--surface);
 color:var(--ink);border:1px solid var(--line);border-radius:5px;padding:8px 12px}
.r2-transfer-questions{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
.r2-transfer-question{border:1px solid var(--line);border-radius:6px;padding:18px;min-width:0}
.r2-transfer-code{font:14px/1.75 "Cascadia Code",Consolas,monospace;color:#ecf0ff;
 background:#111923;border:1px solid #364359;border-radius:5px;padding:16px;
 overflow-x:auto;max-width:100%;white-space:pre}
.r2-transfer-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}
.r2-transfer-option{min-height:44px;border:1px solid var(--line);border-radius:5px;
 background:var(--surface);color:var(--ink);padding:12px 14px;text-align:left;
 font-size:15px;line-height:1.6;overflow-wrap:anywhere}
.r2-transfer-option[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft)}
.r2-transfer-hint{font-size:15px;line-height:1.65}
.r2-transfer-hint summary{min-height:44px;padding:10px 0;cursor:pointer;font-weight:700}
.r2-transfer-feedback{padding:12px 15px;font-size:15px;line-height:1.75;
 background:var(--surface-muted);border-left:3px solid var(--line);white-space:pre-wrap;
 overflow-wrap:anywhere}
.r2-transfer-feedback:empty{display:none}
.r2-transfer-feedback[data-status="correct"]{border-color:var(--success)}
.r2-transfer-feedback[data-status="review"]{border-color:var(--error)}
#r2-transfer-justification .r2-transfer-question{border-left:3px solid var(--accent)}
@media(max-width:640px){
 #r2-transfer{margin:20px 0;padding:18px 15px}
 .r2-transfer-question{padding:14px 10px}
 .r2-transfer-options{grid-template-columns:minmax(0,1fr)}
}


/* L9 independent mathematical checks and learner evidence export */
#r2-variants{max-width:1260px;margin:28px auto;padding:clamp(18px,2.5vw,34px);border:1px solid var(--line);border-radius:8px;background:var(--surface);min-width:0}
#r2-variants h2{font-size:clamp(23px,2.4vw,29px);margin:0 0 14px}
#r2-variants h3{font-size:21px;margin:24px 0 15px}
#r2-variants h4{font-size:16px;line-height:1.5;margin:0 0 13px}
.r2-variants-intro,.r2-variants-context,.r2-variants-assumption,.r2-variants-progress,.r2-variants-review-explain{font-size:15px;line-height:1.75;max-width:83ch;overflow-wrap:anywhere}
.r2-variants-assumption{border-left:3px solid var(--accent);background:var(--surface-muted);padding:12px 16px}
.r2-variants-controls{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:18px 0}
.r2-variants-controls label{font-size:15px;font-weight:700}
#r2-variants-select{font-size:15px;min-height:44px;max-width:100%;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:5px;padding:8px 12px}
.r2-variants-questions{display:grid;grid-template-columns:minmax(0,1fr);gap:15px}
.r2-variant-question{border:1px solid var(--line);border-radius:6px;min-width:0;padding:18px}
.r2-variant-code{font:14px/1.75 "Cascadia Code",Consolas,monospace;color:#ecf0ff;background:#111923;border:1px solid #364359;border-radius:5px;padding:16px;white-space:pre;max-width:100%;overflow-x:auto}
.r2-variant-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:15px 0}
.r2-variant-option,#r2-variants-export{min-height:44px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:5px;padding:11px 14px;font-size:15px;text-align:left;line-height:1.55;overflow-wrap:anywhere}
.r2-variant-option[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft)}
.r2-variant-hint{font-size:15px;line-height:1.65}
.r2-variant-hint summary{cursor:pointer;min-height:44px;padding:10px 0;font-weight:700}
.r2-variant-feedback{font-size:15px;line-height:1.7;background:var(--surface-muted);border-left:3px solid var(--line);padding:12px 15px;white-space:pre-wrap;overflow-wrap:anywhere}
.r2-variant-feedback:empty{display:none}
.r2-variant-feedback[data-result="correct"]{border-color:var(--success)}
.r2-variant-feedback[data-result="review"]{border-color:var(--error)}
#r2-variants-export{border-color:var(--accent);background:var(--accent-soft);font-weight:700}
#r2-variants-export-status{font-size:15px;line-height:1.6}
@media(max-width:650px){#r2-variants{padding:18px 15px;margin:20px 0}.r2-variant-question{padding:14px 10px}.r2-variant-options{grid-template-columns:minmax(0,1fr)}}
