:root{font-family:system-ui,sans-serif;color:#163a3b;background:#f1f5f3;--green:#24674d;--line:#cddbd5;--dark:#17252c}*{box-sizing:border-box}body{margin:0}header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:16px 22px;background:#173d3d;color:white;flex-wrap:wrap}header small{letter-spacing:.12em;font-size:10px;color:#b9dcd1}h1{font-size:clamp(20px,2vw,28px);margin:4px 0}h2{font-size:19px;line-height:1.3;margin:8px 0 12px}h3{font-size:14px;margin:16px 0 5px}p,li{font-size:14px;line-height:1.55}ol{padding-left:22px}li{margin:6px 0}button{font:inherit;font-size:13px;min-height:36px;border:1px solid #adbfba;background:white;color:#173d3d;padding:7px 11px;border-radius:6px;cursor:pointer}button:hover{background:#e0ece6}button:disabled{opacity:.5;cursor:default}.primary{background:var(--green);color:white;border-color:var(--green)}.primary:hover{background:#18523c}button:focus-visible,textarea:focus-visible,summary:focus-visible,input:focus-visible{outline:3px solid #4da0db;outline-offset:2px}.tools,.lesson-actions{display:flex;gap:7px;align-items:center;flex-wrap:wrap}.auto{font-size:13px}.notice{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;background:#e0ede5;padding:9px 20px;font-size:12px}.workspace{display:grid;grid-template-columns:minmax(230px,27fr) minmax(300px,40fr) minmax(260px,33fr);gap:12px;padding:12px;min-height:calc(100vh - 113px);align-items:stretch}.panel{min-width:0;border:1px solid var(--line);border-radius:9px;background:white;overflow:hidden}.section-label{font-size:11px;font-weight:700;letter-spacing:.1em;padding:12px 14px;background:#e8efeb;color:#48645a;border-bottom:1px solid var(--line)}nav{display:grid;gap:4px;padding:10px 12px;background:#f6f8f6;border-bottom:1px solid var(--line)}nav button{text-align:left;min-height:32px;font-size:12px}nav button.active{background:#24674d;color:white;border-color:#24674d}.lesson-body{padding:14px}.eyebrow{font-size:11px;font-weight:700;text-transform:uppercase;color:#52756a;letter-spacing:.08em}.lesson-body label{display:block;font-size:12px;font-weight:600;margin-top:14px}textarea{font:inherit}#reflection{width:100%;resize:vertical;margin:6px 0 12px;padding:8px;border:1px solid var(--line);border-radius:5px}.lesson pre{font:12px/1.5 ui-monospace,monospace;white-space:pre-wrap;overflow-wrap:anywhere;background:#edf2ef;padding:9px;border-radius:5px;max-height:300px;overflow:auto}details{margin:10px 0}summary{cursor:pointer;font-size:13px;font-weight:600}.editor{display:flex;flex-direction:column;background:var(--dark);color:#dce7e3}.editor .section-label{background:#263d43;color:#bdd1c9;border-color:#354b50}.tabs{display:flex;gap:0;background:#26343b;overflow:auto}.tabs button{border-radius:0;color:#c3d5d0;background:#26343b;border:0;border-right:1px solid #394c52;padding:12px 15px}.tabs button.active{background:#17252c;color:white;border-top:2px solid #6fb995}.editwrap{display:flex;position:relative;min-height:350px;height:58vh;flex:1;overflow:hidden}.editwrap pre,#code{margin:0;font:13px/21px ui-monospace,SFMono-Regular,Consolas,monospace;padding:12px 9px;border:0;tab-size:2}.editwrap pre{width:46px;flex-shrink:0;text-align:right;color:#91aaa6;overflow:hidden;user-select:none;background:#1c2e35}.editwrap textarea{flex:1;width:100%;min-width:0;resize:none;white-space:pre;overflow:auto;background:#17252c;color:#e3ece9;outline:none;border-radius:0;caret-color:white}.editorfoot{display:flex;justify-content:space-between;gap:6px;padding:8px 11px;font-size:10px;background:#26343b;color:#b6ccc4}.console{border-top:1px solid #3d5056;min-height:140px;max-height:220px;overflow:auto}.consolehead{display:flex;align-items:center;justify-content:space-between;font-size:11px;letter-spacing:.09em;padding:6px 10px;background:#24383d}.consolehead button{font-size:10px;min-height:22px;padding:3px 7px}#console{font:12px/1.5 monospace;padding:8px 12px;white-space:pre-wrap;overflow-wrap:anywhere;margin:0;color:#b4dfc8}.previewhead{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;gap:5px}.previewhead h2{margin:0;font-size:15px}#framehost{min-height:260px;background:#e5ece8;margin:0 10px;display:flex;align-items:center;justify-content:center;border-radius:7px;overflow:hidden}iframe{width:100%;height:350px;border:0;background:white}.previewnote,.preview details{padding:0 12px;color:#45615b}.preview details p{font-size:12px}.previewnote{font-size:12px}.error{color:#8d2222}@media(max-width:1000px){.workspace{grid-template-columns:minmax(230px,32fr) minmax(300px,68fr)}.preview{grid-column:1/-1}.editwrap{height:55vh}iframe{height:400px}}@media(max-width:650px){.workspace{grid-template-columns:1fr}.preview{grid-column:auto}.editwrap{height:450px}.tools{width:100%}header{padding:12px}.notice{padding:8px 12px}}
@media(min-width:1001px){.workspace{height:calc(100vh - 113px);min-height:550px;grid-template-rows:minmax(0,1fr)}.lesson,.preview{overflow:auto}.editor{min-height:0}.editwrap{flex:1 1 0;height:auto;min-height:180px}.console{flex:0 0 120px;min-height:100px}.editwrap pre,#code{height:100%;min-height:0}}@media(max-width:1000px){.editwrap{flex:none;height:55vh}.editwrap pre,#code{height:100%}}@media(max-width:650px){.editwrap{height:450px}}
#changes span{display:block;white-space:pre-wrap}.added{color:#216449;background:#dff0e4}.removed{color:#9d322c;background:#f9e4e1}.context{color:#4c6259}#changes{max-height:350px}

/* v0.2: compact learning panel and continuous project navigation */
.learn-label{display:flex;justify-content:space-between;align-items:center;gap:6px;padding:9px 11px}.learn-label #progress{letter-spacing:0;font-size:11px;text-transform:none;font-weight:600;color:#48645a}.lesson-body{padding:10px 12px}.lesson-heading{display:flex;gap:7px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin:0 0 7px}.lesson-heading h2{font-size:16px;line-height:1.25;margin:0;flex:1 1 105px}.lesson-heading nav{display:flex;gap:3px;background:none;padding:0;border:0;flex-wrap:nowrap}.lesson-heading nav button{width:29px;min-width:29px;min-height:30px;padding:3px 0;text-align:center;font-weight:650;font-size:11px;position:relative}.lesson-heading nav button.tested:not(.active){box-shadow:inset 0 -3px #579b70}.lesson-body p,.lesson-body li{font-size:12.5px;line-height:1.4}.lesson-body p{margin:5px 0 9px}.lesson-body h3{font-size:12px;margin:9px 0 3px}.lesson-body ol{margin:3px 0 9px;padding-left:19px}.lesson-body li{margin:3px 0}.help-tools{border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin:9px 0;padding:3px 0}.help-tools details{margin:0;padding:6px 0}.help-tools details+details{border-top:1px solid #e6eeea}.help-tools summary{font-size:12px}.help-tools pre{margin:5px 0;font-size:11px}.lesson-body label{margin-top:5px}.check-row{display:flex;flex-wrap:wrap;gap:4px 9px;align-items:center;margin:6px 0 9px}.check-row label{display:flex;gap:5px;align-items:center;margin:0}.check-row input{margin:0}.micro{font-size:10px!important;color:#64766f}.lesson-actions{justify-content:space-between;gap:5px}.lesson-actions button{min-height:34px;font-size:12px;padding:6px 9px}.lesson-body .continuity{font-size:11px;color:#42685a;background:#eff6f1;padding:6px 8px;border-radius:5px;margin:8px 0 5px}.restart{margin:6px 0}.restart summary{font-size:11px;color:#65766f}.color-strip{display:inline-flex;gap:3px;vertical-align:middle;margin-left:6px}.color-strip i{display:block;width:12px;height:12px;border-radius:3px;border:1px solid #8b9992}.swatches{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}.swatches button{min-height:30px;font-size:11px;display:flex;align-items:center;gap:5px;text-align:left;padding:4px 5px;overflow:hidden}.swatches i{width:16px;height:16px;flex:0 0 16px;border-radius:4px;border:1px solid #83918a}.swatches code{font-size:11px;overflow-wrap:anywhere}.color-example{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:8px}.color-example label{margin:0;font-size:11px}.color-example input{width:32px;height:29px;padding:0;border:0}.color-example button{min-height:28px;padding:3px 6px;font-size:11px}.color-example code{font-size:11px}.lesson .palette p{font-size:11px}.lesson pre{max-height:240px}.lesson #changes{max-height:290px}@media(min-width:1001px){.workspace{grid-template-columns:minmax(290px,27fr) minmax(280px,40fr) minmax(245px,33fr);gap:10px;padding:10px}}@media(max-width:650px){.lesson-heading h2{flex:1 1 120px}.lesson-heading nav button{min-width:30px;width:30px}}

/* v0.3: profile selector and pinned Phaser runtime panel */
.project-select{display:flex;align-items:center;gap:6px;font-size:11px;color:#d5e8df;margin-top:5px}.project-select select{font:inherit;font-size:12px;background:#fff;color:#173d3d;border:1px solid #b2c6bd;border-radius:5px;padding:5px 7px;max-width:100%}.phaser-project .lesson-heading nav{flex-wrap:wrap;max-width:100%;justify-content:flex-start}.phaser-project .lesson-heading h2{flex:1 1 100%}.phaser-project .lesson-heading nav button{width:25px;min-width:25px;min-height:28px}.phaser-project iframe{height:clamp(330px,45vw,650px)}#runtimePanel{padding:10px;margin:0 10px 8px;background:#eef5f0;border:1px solid #cddbd5;border-radius:7px;font-size:12px}#runtimePanel p{font-size:11px;margin:4px 0}#runtimePanel a{color:#075d9c}.runtime-actions{display:flex;flex-wrap:wrap;gap:5px}.runtime-actions button{font-size:11px;min-height:30px;padding:5px 8px}#runtimePanel[hidden]{display:none}
@media(max-width:650px){.phaser-project iframe{height:430px}}

@media(min-width:1001px){body{height:100vh;display:flex;flex-direction:column}header{flex:0 0 auto;padding:11px 18px}header h1{font-size:24px}.notice{flex:0 0 auto}.workspace{height:auto;min-height:0;flex:1 1 0;grid-template-rows:minmax(0,1fr)}.phaser-project iframe{height:clamp(330px,38vw,570px)}}
