:root{font-family:system-ui,-apple-system,"Segoe UI",sans-serif;color:#202b39;background:#f5f7fa;font-size:16px;line-height:1.6;--accent:#225cc8;--border:#dce3ec}*{box-sizing:border-box}body{margin:0}a{color:var(--accent);text-underline-offset:3px}header{background:#fff;border-bottom:1px solid var(--border);padding:18px max(24px,calc((100vw - 1240px)/2));display:flex;align-items:center;justify-content:space-between;gap:24px}.brand{font-size:26px;font-weight:800;text-decoration:none;letter-spacing:-1px;color:#163a68}.brand span{display:block;font-size:11px;color:#69788b;letter-spacing:1px;font-weight:500}nav{display:flex;align-items:center;gap:20px;font-size:14px}nav form{margin:0}main{max-width:1288px;margin:36px auto 80px;padding:0 24px;min-height:65vh}h1{font-size:clamp(25px,3vw,36px);line-height:1.25;font-weight:720;letter-spacing:-.7px;margin:14px 0 26px}h2{font-size:21px;line-height:1.35}p{margin:.7em 0 1em}.eyebrow{font-size:12px;font-weight:650;color:#6c7d91;letter-spacing:1px;margin:0 0 6px}.card{background:#fff;border:1px solid var(--border);border-radius:12px;padding:24px}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:20px}.course-link{text-decoration:none;transition:border-color .15s}.course-link:hover{border-color:var(--accent)}.course-link span,.meta{color:#69788b;font-size:13px}.materials{list-style:none;padding:0;max-width:880px;display:grid;gap:12px}.materials li{padding:16px 22px}.materials li>a{font-weight:650;font-size:18px;text-decoration:none}.login{max-width:440px;margin:70px auto}.login form{display:grid;gap:10px}.login h1{margin-bottom:12px}label{display:block;font-weight:600;font-size:14px}input,textarea,select{font:inherit;padding:10px 12px;border:1px solid #b6c2d1;border-radius:6px;max-width:100%;width:100%;background:white;color:inherit}button{font:inherit;cursor:pointer;border:1px solid transparent;background:var(--accent);color:white;padding:10px 18px;border-radius:7px;font-size:14px;font-weight:600;min-height:42px}button:hover{background:#194da9}.quiet{background:#eef3fb;color:#225cc8}.quiet:hover{background:#e0e9f8}:focus-visible{outline:3px solid #df9c25;outline-offset:3px}input:focus,textarea:focus,select:focus{outline:none;border-color:#9ba8b8}.skip{position:absolute;left:12px;top:-100px;background:#fff;padding:8px;z-index:10}.skip:focus{top:4px}.lesson-layout{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(320px,.88fr);gap:22px;align-items:start}.lesson-layout:has(>article:only-child){grid-template-columns:minmax(0,900px)}.prose{overflow-wrap:anywhere;padding:28px 32px}.prose>:first-child{margin-top:0}.prose img{display:block;max-width:100%;height:auto;margin:16px 0}.prose img[data-align="center"]{margin-left:auto;margin-right:auto}.prose img[data-align="right"]{margin-left:auto;margin-right:0}.prose pre{background:#f4f6f9;padding:8px 14px;border-radius:7px;overflow-x:auto;font:14px/1.55 Consolas,monospace;white-space:pre;overflow-wrap:normal;margin:16px 0}.prose code{font: .9em Consolas,monospace;background:#eff3f8;padding:2px 4px;border-radius:3px}.prose pre code{background:none;padding:0}.prose blockquote{margin:18px 0;border-left:3px solid #89a5d1;padding:2px 18px;color:#40536b;background:#f9fbfe}.prose table{border-collapse:collapse;display:block;max-width:100%;overflow-x:auto;margin:16px 0}.prose th,.prose td{border:1px solid var(--border);padding:8px 12px}.prose .lnt,.prose .ln{color:#8e9eaf;user-select:none;margin-right:18px}.chroma .k,.chroma .kt,.chroma .kd{color:#a73193}.chroma .s,.chroma .s1,.chroma .s2{color:#14764c}.chroma .c,.chroma .c1,.chroma .cm{color:#728197}.chroma .nf{color:#215eb9}.chroma .m,.chroma .mi{color:#ad5928}textarea{font:14px/1.55 Consolas,monospace;min-height:360px;resize:vertical;tab-size:4;white-space:pre;overflow:auto}.completion{margin:22px 0}.error{background:#fff0ee;border-left:3px solid #bb3c32;padding:12px;color:#8f2d27}.back{font-size:14px}.actions{display:flex;flex-wrap:wrap;gap:10px;margin:15px 0}footer{border-top:1px solid var(--border);text-align:center;padding:22px;color:#7b8899;font-size:13px}@media(max-width:820px){header{padding:14px 18px;align-items:flex-start}nav{gap:10px;flex-wrap:wrap;justify-content:flex-end}nav span{display:none}main{margin-top:24px;padding:0 16px}.lesson-layout{grid-template-columns:1fr}.prose{padding:20px}.card{border-radius:9px}h1{margin-bottom:20px}.login{margin-top:35px}textarea{min-height:280px}}

.table-scroll{overflow-x:auto;margin:18px 0}table{border-collapse:collapse;width:100%;font-size:14px}th,td{text-align:left;border-bottom:1px solid var(--border);padding:12px 14px;vertical-align:top}th{background:#f2f5f9;font-weight:650}main>section+section{margin-top:24px}.source-view{margin:24px 0}.source-view pre,.example{font:14px/1.55 Consolas,monospace;white-space:pre;overflow:auto;background:#f3f6fa;border-radius:6px;padding:14px;max-width:100%;tab-size:4}.history{margin-top:30px}.history li{margin:8px 0}.test-results{padding-left:24px}.test-results li{margin:12px 0}.review-comment{white-space:pre-wrap}.inline-form{display:flex;gap:14px;flex-wrap:wrap;align-items:end}.inline-form label{flex:1;min-width:140px}.inline-form input,.inline-form select{margin-top:6px}progress{width:min(100%,880px);height:10px;accent-color:var(--accent)}.lesson-nav{display:flex;justify-content:space-between;gap:24px;margin-top:32px;padding-top:20px;border-top:1px solid var(--border)}.lesson-nav a{max-width:48%}.archive-notice{border-left:3px solid #bc9254;background:#fff8ed;padding:12px 16px}.grades{display:grid;grid-template-columns:max-content 1fr;gap:4px 18px}.grades dt{color:#65758a}.grades dd{margin:0}.code-editor .cm-scroller{max-height:560px}.muted{font-size:12px;color:#758195}.result{margin:20px 0}button:disabled{opacity:.55;cursor:wait}#live-result{padding:4px 0 16px}#live-result:empty{display:none}

.badge-image{width:96px;height:96px;object-fit:contain}#manual-source{min-height:160px;font-family:inherit;white-space:pre-wrap}

.lesson-layout>*{min-width:0}.code-editor{min-width:0;max-width:100%}@media(max-width:820px){.lesson-layout{grid-template-columns:minmax(0,1fr)}}

.course-week{max-width:880px;margin-top:36px}.course-week h2{margin-bottom:16px}.course-week .materials{margin:0}
.course-week summary{cursor:pointer;display:list-item;padding:3px 0}.course-week summary h2{display:inline;margin:0}.course-week .week-summary{color:#526276;margin:12px 0 18px;max-width:75ch}
.js .lesson-layout.quiz-pending{display:none}#task-stdin{min-height:90px}#run-result{margin:12px 0}#run-result pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#f3f6fa;padding:12px;border-radius:6px}.load-attempt{margin-left:8px;min-height:34px;padding:5px 10px}.quiz-intro{max-width:900px;margin:0 0 20px}
.example-run{margin:1.5rem 0 2rem}.example-stage{position:relative;border:1px solid #ccc;background:linear-gradient(to right,#f0f0f0 var(--example-gutter-width,0px),#fff 0);padding:.5rem 0;isolation:isolate}.example-language{position:absolute;z-index:2;top:-.5rem;left:.5rem;padding:0 .375rem;border:1px solid #ccc;border-radius:.25rem;background:#fff;color:#57606a;font-size:.75rem;line-height:1rem}.example-run label{display:block;margin:1.25rem 0 .35rem;font-weight:600}.example-run textarea{display:block;width:100%;min-height:0;padding:.5rem;font:14px/1.4 Consolas,monospace;resize:vertical}.example-run textarea[name="source"]{min-height:12rem;border:0;border-radius:0}.example-stage .code-editor{margin:0;border:0;border-radius:0}.example-stage .cm-editor{font:14px/1.4 Consolas,"Liberation Mono",monospace}.example-stage .cm-content{padding:0}.example-stage .code-editor .cm-gutters{background:#f0f0f0;border:0}.example-stage .cm-activeLine{background:#eee}.example-stage .cm-line{padding:0 4px}.example-stage .cm-activeLineGutter{background:#ddd}.example-run .example-actions{position:absolute;z-index:2;bottom:-.75rem;left:.5rem;gap:.25rem;margin:0}.example-stage button{display:grid;place-items:center;width:1.5rem;height:1.5rem;min-height:0;padding:.125rem;border:1px solid #aab2ba;border-radius:.25rem;background:#fff;color:#344054}.example-stage button[type="submit"]{color:#198754}.example-stage button:hover{border-color:#475467;background:#f3f4f6}.example-stage button:active:not(:disabled){background:#e5e7eb}.example-stage button:disabled{opacity:1;cursor:not-allowed}.example-stage button[aria-busy="true"]{background:#fff;cursor:wait}.example-stage button[aria-busy="true"] svg{display:none}.example-stage button[aria-busy="true"]::after{content:"";box-sizing:border-box;width:1rem;height:1rem;border:2px solid #d1e7dd;border-top-color:currentColor;border-radius:50%;animation:example-spin .8s linear infinite}.example-stage button svg{width:1rem;height:1rem}.example-copy{position:absolute;z-index:2;top:-.75rem;right:.5rem}.example-copy.is-copied{color:#1a7f37}.example-copy.is-copy-error{color:#b42318}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.example-output:empty{display:none}.example-output{margin-top:1.25rem;white-space:normal}.example-output pre{white-space:pre-wrap;overflow-wrap:anywhere;padding:.75rem;background:#f8f9fa;border:1px solid #d3dce7;border-radius:.25rem}@media(pointer:coarse){.example-stage button{width:2.25rem;height:2.25rem}.example-run .example-actions{bottom:-1.125rem}.example-copy{top:-1.125rem}.example-run label{margin-top:1.5rem}}

@keyframes example-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.example-stage button[aria-busy="true"]::after{animation:none}}
.lesson-nav{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px 20px;margin-top:20px;padding-top:12px}.lesson-nav a{max-width:none;overflow-wrap:anywhere}.lesson-previous{grid-column:1;grid-row:1;justify-self:start}.lesson-next{grid-column:3;grid-row:1;justify-self:end;text-align:right}.lesson-nav .completion{grid-column:2;grid-row:1;margin:0;text-align:center}.completion button{white-space:nowrap}.completion .action-message:not(.visually-hidden){max-width:240px;margin:6px 0 0;overflow-wrap:anywhere}main:has(>.lesson-nav){margin-bottom:20px}body:has(main>.lesson-nav)>footer{padding:10px 24px}@media(max-width:640px){.lesson-nav{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 16px;justify-content:normal}.lesson-nav .completion{grid-column:1/-1;grid-row:1;justify-self:center}.lesson-nav:has(.completion) .lesson-previous,.lesson-nav:has(.completion) .lesson-next{grid-row:2}.lesson-next{grid-column:2}}@media(pointer:coarse){.lesson-nav a{display:flex;align-items:center;min-height:44px}.lesson-nav button{min-height:44px}}

/* Task workspace: preserve the editor DOM while switching information panels. */
.task-tabs,.console-tabs{display:none}
.task-workspace{gap:0 16px;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:min-content minmax(0,1fr)}
.task-workspace.tabs-ready .task-tabs,.task-workspace.tabs-ready .console-tabs{display:flex;gap:4px;align-items:center;flex-wrap:wrap}
.task-workspace [hidden]{display:none!important}
.task-tabs{grid-column:1;grid-row:1;background:#fff;border:1px solid var(--border);border-bottom:0;border-radius:12px 12px 0 0;padding:6px 10px}
.task-tabs button,.console-tabs button{background:transparent;color:#69788b;border-radius:6px;padding:8px 12px;min-height:42px}
.task-tabs button:hover,.console-tabs button:hover{background:#eef3fb;color:var(--accent)}
.task-tabs button[aria-selected="true"],.console-tabs button[aria-selected="true"]{background:#eef3fb;color:var(--accent)}
.task-information{grid-column:1;grid-row:2;padding:24px;border-radius:0 0 12px 12px}
.task-information .prose{padding:0}.task-information .history{margin:0}.task-information h2{margin-top:0}
.task-code{grid-column:2;grid-row:1 / span 2;padding:18px;min-width:0}
.task-editor-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.task-editor-heading h2{margin:0}
.task-code .meta{margin:6px 0}.task-code label[for="source"]{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.task-code .code-editor{margin-top:12px}.task-code .actions{gap:8px;margin:12px 0}.task-code .actions>button{padding:8px 12px}
.task-tools{position:relative;margin-left:auto}.task-tools summary{cursor:pointer;list-style:none;min-width:42px;min-height:42px;display:grid;place-items:center;border:1px solid var(--border);border-radius:7px;font-size:22px;line-height:1}.task-tools summary::-webkit-details-marker{display:none}
.task-tools[open] button{position:absolute;right:0;top:48px;z-index:5;min-width:210px;box-shadow:0 6px 20px #202b3926;border:1px solid var(--border)}
.console-tabs{border-top:1px solid var(--border);padding-top:10px;margin-top:12px;margin-bottom:12px}
.task-code #panel-input,.task-code #panel-result{min-height:130px}.task-code #task-stdin{min-height:100px;margin-top:6px}.task-code #panel-result:has(#run-result:not(:empty),#live-result:not(:empty)) .task-result-placeholder{display:none}
@media(min-width:821px){.task-workspace.tabs-ready .task-information{min-height:420px}.task-workspace.tabs-ready:not(.task-wide) #tab-code{display:none}}
@media(max-width:820px){.task-workspace{grid-template-columns:minmax(0,1fr);gap:0}.task-tabs{grid-column:1;grid-row:1;padding:6px;gap:0!important;flex-wrap:nowrap!important}.task-tabs button{flex:1;padding:8px 6px;min-width:0}.task-information,.task-code{grid-column:1;grid-row:2;border-radius:0 0 9px 9px;padding:16px}.task-code .actions>button{flex:1}.task-code .actions{align-items:center}.task-code .code-editor .cm-scroller{max-height:55vh}}
.task-heading-tools{display:flex;align-items:center;gap:12px}.task-heading-tools .task-tools{margin:0}.task-heading-tools .task-tools summary{font-size:20px;min-height:34px;min-width:34px}.task-heading-tools .task-tools[open] button{top:40px}.task-tools button{white-space:normal}

/* Course outline: native disclosure works with keyboard and without JavaScript. */
.lesson-topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;position:relative;margin-bottom:8px}
.lesson-topbar>.back{min-width:0;overflow-wrap:anywhere}
.course-outline{flex:none}
.course-outline>summary{cursor:pointer;list-style:none;min-height:44px;display:flex;align-items:center;gap:10px;padding:8px 12px;border:1px solid var(--border);border-radius:7px;background:#fff;color:var(--accent);font-size:14px;font-weight:600}
.course-outline>summary::-webkit-details-marker{display:none}
.course-outline>summary .outline-icon{display:block;flex:none;width:18px;height:18px}
.course-outline[open]>summary{background:#eef3fb}
.course-outline-panel{position:absolute;right:0;top:100%;margin-top:8px;z-index:30;display:block;width:min(440px,100%);max-height:min(65vh,620px);overflow:auto;overscroll-behavior:contain;background:#fff;border:1px solid var(--border);border-radius:10px;padding:8px;box-shadow:0 10px 32px #202b3926;text-align:left}
.outline-week>summary{cursor:pointer;padding:12px 10px;font-weight:650;font-size:14px;line-height:1.5;border-radius:6px}
.outline-week>summary:hover{background:#f3f6fa}
.outline-week ol{list-style:none;margin:0;padding:0 0 8px}
.course-outline-panel a{display:block;min-height:44px;padding:9px 12px;text-decoration:none;border-radius:6px;overflow-wrap:anywhere;color:inherit}
.course-outline-panel a:hover{background:#f3f6fa}
.course-outline-panel a[aria-current="page"]{background:#eef3fb;box-shadow:inset 3px 0 var(--accent)}
.course-outline-panel .outline-title{display:block;font-size:14px;line-height:1.5}
.course-outline-panel .outline-meta{display:block;margin-top:3px;font-size:12px;color:#65758a}
.course-outline summary:focus-visible,.course-outline a:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media(max-width:640px){.lesson-topbar{align-items:flex-start;flex-wrap:wrap}.course-outline{margin-left:auto}.course-outline-panel{width:100%;max-height:60dvh}.course-outline-panel .outline-meta span{display:inline}}
.course-outline-panel [data-outline-status]{display:inline}

/* Compact task pages and a full-width workspace; panels keep their editor DOM. */
main.task-page{max-width:1600px;margin-top:16px;padding:0 20px}
.task-page .lesson-topbar{margin-bottom:4px}
.task-page .activity-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
.task-page .activity-heading h1{font-size:clamp(24px,2.4vw,30px);margin:4px 0}
.task-layout-toggle{flex:none}
.task-page .task-information{padding:18px}
.task-page .task-code{padding:16px}
@media(min-width:821px){
  .task-workspace.task-wide{grid-template-columns:minmax(0,1fr)}
  .task-wide .task-tabs{grid-column:1;grid-row:1}
  .task-wide .task-information,.task-wide .task-code{grid-column:1;grid-row:2;border-radius:0 0 12px 12px}
  .task-wide .task-information .prose{max-width:100ch}
}
@media(max-width:820px){
  main.task-page{margin-top:12px;padding:0 12px}
  .task-layout-toggle{display:none}
  .task-page .activity-heading{margin-bottom:12px}
  .task-page .task-information,.task-page .task-code{padding:14px}
}
@media(min-width:821px){.task-wide .task-code .cm-scroller{min-height:min(36vh,360px);max-height:60vh}}
