:root{font-family:system-ui,-apple-system,Segoe UI,Arial,sans-serif;color-scheme:dark}*{box-sizing:border-box}body{background:radial-gradient(ellipse at 80% -10%,#24576d 0,#0b1b30 60%,#071321 100%);color:#effdf8;margin:0;min-height:100vh}a{color:#a9f4e5}.skip{position:absolute;top:-99px}.skip:focus{top:10px;left:10px;background:#fff;color:#123;padding:12px;z-index:50}.top{padding:19px max(22px,calc((100vw - 1170px)/2));display:flex;align-items:center;justify-content:space-between;gap:20px;border-bottom:1px solid #38616c;flex-wrap:wrap}.brand{color:#f4faf8;text-decoration:none;font-weight:900;letter-spacing:.12em}.brand span{color:#90e7ce}.top nav{display:flex;gap:17px;flex-wrap:wrap;font-size:14px}.top nav a{text-decoration:none}.layout{max-width:1170px;margin:0 auto;padding:30px 18px}.hero{background:linear-gradient(130deg,#17394e,#153b49 70%,#28555e);border:1px solid #467b87;border-radius:24px;padding:30px 34px;display:flex;justify-content:space-between;align-items:center;gap:18px}.hero small,.section-label{font-size:12px;letter-spacing:.09em;font-weight:800;color:#9ce6d7}.hero h1{font-size:clamp(27px,4vw,44px);margin:11px 0;line-height:1.2}.hero h1 span{font-size:.9em}.hero p{font-size:16px;color:#d1e9e9;max-width:690px}.tags{display:flex;gap:9px;flex-wrap:wrap;margin-top:20px}.tags span{font-size:12px;border:1px solid #6aa6aa;padding:7px 11px;border-radius:20px;background:#092a3e}.hero-numbers{min-width:145px;text-align:center;background:#09283b9e;padding:18px 22px;border-radius:18px;border:1px solid #5d9692}.hero-numbers strong{display:block;font-size:34px;color:var(--subject-accent)}.hero-numbers span,.hero-numbers small{display:block;font-size:12px;color:#c5e9db;margin-top:5px}.info,.feedback{margin-top:18px;padding:14px 19px;background:#18445b;border:1px solid #5b9aa4;border-radius:12px}.info a{margin-left:10px}.warning{border-color:#b9906b}.columns{display:grid;grid-template-columns:315px minmax(0,1fr);gap:22px;margin-top:24px;align-items:start}.chapters,.lesson{background:#112b3b;border:1px solid #386574;border-radius:20px;padding:24px}.section-label{margin-bottom:19px}.section-label span{letter-spacing:normal;color:#bcd5dc}.chapter-list{display:grid;gap:9px}.chapter{display:flex;gap:11px;align-items:center;text-decoration:none;padding:14px 12px;border:1px solid #356072;border-radius:13px;background:#163548;color:#e8f6f2}.chapter:hover,.chapter.active{border-color:var(--subject-accent);background:#224958}.chapter-no{font-weight:900;color:var(--subject-accent)}.chapter-copy{display:grid;gap:5px;flex:1}.chapter-copy strong{font-size:14px}.chapter-copy small{font-size:12px;color:#b0cdd0}.chapter-check{font-weight:900;color:#a9efcb}.chapter-footer{font-size:13px;color:#adccca;margin-top:20px}.lesson h2{font-size:clamp(24px,3vw,33px);margin:10px 0}.lesson h3{font-size:19px}.goal{font-size:17px;color:#d8eceb}.steps{padding-left:27px}.steps li{padding:9px 5px;line-height:1.55}.steps li::marker{color:#7bedd2;font-weight:900}.result,.review{padding:16px 18px;border-radius:12px;background:#21475a;border:1px solid #5e8792;margin:20px 0}.result p{margin-bottom:0}.tip{border:1px solid #446877;padding:12px 16px;border-radius:12px}.tip summary{font-weight:750;cursor:pointer}.work-form{margin-top:27px}.work-form label:not(.option){display:block;margin:16px 0 9px;font-weight:750}.work-form textarea{background:#081c2b;border:1px solid #64858f;border-radius:11px;color:#f6fcff;padding:14px;width:100%;font:inherit;line-height:1.55;resize:vertical}.work-form textarea:focus-visible,.work-form button:focus-visible,.work-form input:focus-visible{outline:3px solid #addfd3;outline-offset:2px}.work-form textarea.code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;tab-size:4}.work-form textarea:disabled{opacity:.72}.help{color:#b5d3d8;font-size:12px}.work-form fieldset{border:1px solid #466879;border-radius:12px;margin:23px 0;padding:16px}.work-form legend{font-weight:800;color:var(--subject-accent);padding:0 8px}.option{display:flex;align-items:center;gap:9px;margin:11px 0;padding:11px;border:1px solid #396577;border-radius:10px;cursor:pointer}.option:has(input:checked){background:#214c56;border-color:var(--subject-accent)}.option input{accent-color:#67d5bb}.buttons{display:flex;flex-wrap:wrap;gap:11px;margin-top:20px}.buttons button{border:1px solid #6d929c;background:#17394e;color:#ecfaf5;border-radius:10px;padding:12px 16px;font-size:15px;font-weight:800;cursor:pointer}.buttons .submit{background:#c4e9ca;color:#123b39;border-color:#c4e9ca}.buttons button:disabled{opacity:.48;cursor:not-allowed}.feedback.error{background:#66323b;border-color:#dc8795}.review small{color:#adccce}.layout footer{text-align:center;padding:30px 0;color:#9fc0c7;font-size:13px}@media(max-width:780px){.columns{grid-template-columns:1fr}.chapters{padding:16px}.chapter-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}.hero{flex-direction:column;align-items:stretch;padding:23px}.hero-numbers{text-align:left}.top{padding:16px}.lesson{padding:19px}}

/* Curriculum 3.3 map and learning stations */
.curriculum-note{margin-top:16px;padding:13px 18px;border:1px solid #517c86;border-radius:14px;background:#102e42;line-height:1.6;color:#daeae9;font-size:13px}
.curriculum-note a{display:inline-block;margin-left:7px}
.curriculum-note small{display:block;color:#a6bdc5;font-size:12px;margin-top:4px}
.curriculum-note .emphasis{color:#f5d6a4;font-weight:700}
.progress{height:8px;margin-top:13px;overflow:hidden;background:#27495e;border-radius:20px}
.progress span{display:block;height:100%;background:var(--subject-accent);border-radius:20px}
.sidebar-intro{font-size:13px;color:#b9d3dc;line-height:1.55;margin:-5px 0 18px}
.chapter-group{border:1px solid #476677;border-radius:15px;margin:11px 0;background:#133449;overflow:hidden}
.chapter-group[open]{border-color:#6e9e9d;background:#173a4a}
.chapter-group summary{list-style:none;display:flex;align-items:center;gap:9px;padding:15px 11px;cursor:pointer}
.chapter-group summary::-webkit-details-marker{display:none}
.chapter-group summary:focus-visible{outline:3px solid #adebd4;outline-offset:-3px}
.chapter-icon{font-size:20px;color:var(--subject-accent)}.chapter-title{flex:1;display:grid;gap:5px;min-width:0}
.chapter-title strong{font-size:13px;line-height:1.3}.chapter-title small{font-size:11px;color:#a8cfd3;line-height:1.35}
.disclosure{font-size:20px;transform:rotate(0);transition:transform .15s}.chapter-group[open] .disclosure{transform:rotate(180deg)}
.chapter-missions{padding:2px 9px 11px;display:grid;gap:6px}.chapter-missions .chapter{padding:9px 10px;border-radius:9px}
.chapter-no{font-size:12px}.module-tag{display:inline-block;border:1px solid #527f92;color:#b3ede2;border-radius:18px;font-size:12px;font-weight:800;padding:5px 11px;margin:2px 0 10px}
.story,.knowledge,.criteria{margin:22px 0;padding:20px;border:1px solid #557887;border-radius:15px;line-height:1.65}
.story{background:linear-gradient(120deg,#234853,#213454)}.story strong{color:#e3efbf}.story p,.knowledge p{margin-bottom:0}
.knowledge{background:#163d48;border-color:#638d92}.knowledge h3,.criteria h3{margin:0 0 11px}
.knowledge h4{margin:18px 0 8px;color:#c6eed8}.example{background:#091e2d;border:1px solid #4a6b75;border-radius:11px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:anywhere;padding:15px;color:#e5ffe9;font-size:13px;line-height:1.5}
.knowledge .guide{font-size:12px;color:#bfe0d6}.criteria{background:#203d45;border-color:#668a81}.criteria ul{padding-left:20px}
.criteria li{margin:6px 0}.criteria small,.result small{font-size:12px;color:#b4dacf}
@media(max-width:780px){.chapter-missions{grid-template-columns:1fr}.chapters{padding:15px}.chapter-group{break-inside:avoid}.curriculum-note a{margin-left:0}}
/* 3.8.0 added below, copied into update */
/* 3.8.0 · 40-minute self-contained lessons */
.l40-plan{border:1px solid #759b9c;background:linear-gradient(130deg,#193b50,#16413e);padding:20px;border-radius:18px;margin:22px 0;--l40-progress:0%}.l40-plan-heading{display:grid;gap:7px}.l40-plan-heading strong{font-size:19px;color:#ffe5a8}.l40-plan-heading span,.l40-note{font-size:13px;color:#d1e8e9}.l40-timeline{padding:0;list-style:none;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin:20px 0 14px}.l40-timeline li{min-width:0}.l40-timeline a{height:100%;display:flex;flex-direction:column;gap:4px;text-align:center;align-items:center;text-decoration:none;color:#e1f7f1;background:#163445;border:1px solid #578387;border-radius:12px;padding:10px 5px}.l40-timeline a:hover,.l40-timeline a:focus-visible{background:#29545f;border-color:#b5e9e2}.l40-timeline span{font-size:21px}.l40-timeline strong{font-size:11px;line-height:1.4}.l40-timeline small{color:#bfe3d2;font-size:11px}.l40-actions{display:flex;gap:12px;flex-wrap:wrap;align-items:center;justify-content:space-between}.l40-action{background:#e0f1d6;color:#0e3436;border:0;border-radius:10px;padding:9px 12px;font-weight:800;cursor:pointer}.l40-action:hover{background:#fff6c9}.l40-progress{display:inline-block;border-radius:20px;border:1px solid #8ab7ab;padding:5px 10px;font-size:12px;color:#d5efe9}.l40-phase{scroll-margin-top:20px;margin:22px 0;padding:21px;border:1px solid #527585;border-radius:17px;background:#122d40;line-height:1.7}.l40-phase:nth-of-type(even){background:#163647}.l40-phase.l40-done{border-color:#91c8b6}.l40-phase-head{display:flex;flex-direction:column;gap:4px;margin-bottom:16px}.l40-phase-head>span{font-size:12px;color:#e7ce96;font-weight:800;letter-spacing:.12em}.l40-phase-head h3{margin:0;font-size:clamp(19px,2vw,24px);color:#f3fff1}.l40-phase h4{color:#c8ead8;margin:14px 0 8px}.l40-read{background:#1a4754;border-left:3px solid #a7ded2;border-radius:9px;padding:13px 16px;margin:12px 0}.l40-read p{margin-bottom:0}.l40-lead{color:#d7ece6}.l40-phase .knowledge,.l40-phase .story,.l40-phase .criteria{margin:13px 0}.l40-phase .knowledge p{margin-bottom:10px}.l40-prompt,.l40-sample,.l40-mission-product{padding:15px 18px;border:1px solid #74908d;border-radius:13px;background:#254451}.l40-prompt strong,.l40-sample strong,.l40-mission-product strong{color:#ffdfa3}.l40-prompt p,.l40-sample p,.l40-mission-product p{margin:8px 0}.l40-learn-list{padding-left:25px}.l40-learn-list li{padding:5px}.l40-reveal{border:1px solid #527e85;background:#103246;border-radius:12px;padding:12px 17px;margin:15px 0}.l40-reveal summary{cursor:pointer;font-weight:800;color:#f2dfa9}.l40-reveal p{margin:12px 0 2px}.l40-check{display:flex;align-items:flex-start;gap:12px;background:#184b4c;border:1px solid #719e98;padding:13px;border-radius:12px;margin-top:19px;cursor:pointer}.l40-check input{width:19px;height:19px;margin-top:5px;accent-color:#bde8ca;flex:none}.l40-check span{font-weight:700}.l40-self-check{padding-left:25px}.l40-self-check li{margin:8px 0}.l40-standard{font-size:13px;color:#bfd6dc}.l40-phase .work-form{margin-top:10px}.l40-phase .work-form h3{font-size:19px}.l40-phase .work-form fieldset{margin:15px 0}.lesson .l40-phase :focus-visible{outline:3px solid #ffd895;outline-offset:2px}
@media(max-width:1000px){.l40-timeline{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:610px){.l40-plan,.l40-phase{padding:14px}.l40-timeline{grid-template-columns:repeat(2,minmax(0,1fr))}.l40-timeline a{padding:11px 7px}.l40-phase .example{font-size:12px}}
@media print{body{background:#fff;color:#111}header.top,.hero-numbers,.chapters,.l40-action,.l40-check,.buttons,footer,.tip,nav{display:none!important}.columns{display:block}.lesson,.l40-phase,.l40-plan{background:#fff!important;color:#111!important;border:1px solid #bbb}.l40-phase,.knowledge,.l40-sample,.l40-read,.story,.criteria,.l40-prompt,.l40-reveal,.l40-mission-product{background:#fff!important;color:#111!important}.l40-phase h3,.l40-phase h4,.l40-phase strong,.l40-phase span,.l40-phase p{color:#111!important}.l40-phase{break-inside:avoid;page-break-inside:avoid}.l40-timeline a{color:#111!important;background:#eee!important}.example{color:#111!important;background:#eee!important}}

.l40-scratch{margin:16px 0;display:grid;gap:8px}.l40-scratch textarea{width:100%;min-height:104px;background:#092637;color:#f1fffa;border:1px solid #749fa7;border-radius:12px;padding:12px;font:inherit}.l40-scratch small{font-size:12px;color:#c6dcd8}.l40-transfer{justify-self:start;background:#c2e9d5;color:#1a3641;font-weight:850;border:0;border-radius:10px;padding:9px 14px;cursor:pointer}.l40-hour-scope{background:#344d44;border-left:4px solid #ebd295;padding:13px 16px;border-radius:9px}.l40-scratch textarea:focus-visible,.l40-transfer:focus-visible{outline:3px solid #ffdeaa;outline-offset:2px}

/* 3.9.0 · individually authored, testable lesson editions */
.l39-editorial-mark{display:flex;gap:9px;flex-wrap:wrap;align-items:center;border:1px solid #76baa6;background:#204c4b;padding:12px 15px;border-radius:13px;margin:14px 0}
.l39-editorial-mark strong{color:#ffe0a5}.l39-editorial-mark span{color:#d5eee6;font-size:13px}
.l39-intro{font-size:1.07rem;font-weight:650;color:#f1f8eb;margin:15px 0}
.l39-theory{padding:15px 18px;margin:15px 0;border-radius:13px;background:#163b50;border-left:4px solid #b4e8ce}
.l39-theory h4{margin-top:0}.l39-theory p{margin-bottom:0}
.l39-guided{line-height:1.75;border-left:4px solid #deb970;padding:12px 17px;background:#293f4a;border-radius:9px}
.l39-quiz{margin:20px 0;padding:17px 18px;background:#1c4549;border:1px solid #75a9a2;border-radius:14px}
.l39-quiz fieldset{border:0;padding:0;margin:9px 0;display:grid;gap:10px}
.l39-option{display:flex;align-items:flex-start;gap:10px;padding:10px 13px;background:#103142;border:1px solid #537e83;border-radius:10px;cursor:pointer}
.l39-option:has(input:checked){border-color:#f5d79f;background:#285054}
.l39-option input{flex:none;accent-color:#b5e9d1;min-width:16px;min-height:16px;margin-top:4px}
.l39-check-btn{background:#e4f0d2;color:#11303b;border:0;border-radius:10px;padding:11px 17px;font-weight:800;cursor:pointer}
.l39-feedback{padding:9px 0;margin:7px 0 0;font-size:14px}.l39-feedback[data-correct=yes]{color:#c7f0d5}.l39-feedback[data-correct=no]{color:#ffe3b2}
.l39-rubric{padding-left:25px}.l39-rubric li{margin:7px 0}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.l39-quiz :focus-visible{outline:3px solid #ffde9a;outline-offset:3px}
@media(max-width:610px){.l39-theory,.l39-quiz{padding:12px}.l39-editorial-mark{align-items:flex-start;flex-direction:column}}
@media print{.l39-theory,.l39-quiz,.l39-editorial-mark{background:#fff!important;color:#111!important;border:1px solid #777}.l39-check-btn{display:none}.l39-theory *, .l39-quiz *, .l39-editorial-mark *{color:#111!important}}

/* Misiarium 4.0 · accessible interactive lesson workbench for every grade. */
.m4-workshop{margin:24px 0;border:1px solid #70b9bc;background:#102e40;padding:clamp(12px,3vw,22px);border-radius:18px;color:#f3f7f6}
.m4-workshop-head h4{font-size:1.22rem;margin:9px 0}.m4-workshop-head p{color:#e0e9e9}.m4-chip{display:inline-block;border-radius:100px;padding:6px 12px;background:#244b54;color:#f1efdb;font-size:13px}
.m4-task{border:1px solid #507780;background:#183b4d;border-radius:13px;padding:15px 16px;margin:16px 0}
.m4-task-title{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;align-items:baseline}
.m4-task-title small{color:#d0dedb}.m4-task p{line-height:1.6}
.m4-sort{list-style:none;margin:14px 0;padding:0;display:grid;gap:9px}
.m4-sort li{display:flex;gap:10px;justify-content:space-between;align-items:center;background:#0f2e42;border:1px solid #658d92;border-radius:10px;padding:11px 12px}
.m4-sort-text{flex:1;line-height:1.55}.m4-sort-controls{display:flex;gap:6px;flex-shrink:0}
.m4-sort-controls button{min-width:38px;min-height:38px;background:#d4e6d9;color:#112d3c;border:0;border-radius:8px;font-size:21px;cursor:pointer}
.m4-sort-controls button:disabled{opacity:.4;cursor:not-allowed}
.m4-check-order,.m4-check-proof,.m4-run-lab,.m4-transfer{background:#fae1a9;color:#1c3340;padding:10px 14px;border-radius:9px;border:0;font-weight:750;cursor:pointer;margin:7px 0}
.m4-proofs{display:grid;gap:8px;margin:12px 0}.m4-proofs label{padding:11px;border-radius:9px;border:1px solid #567b86;display:flex;align-items:start;gap:9px;background:#0f3043;cursor:pointer}
.m4-proofs input{accent-color:#8de9ca;min-width:16px;min-height:16px;flex-shrink:0}
.m4-proofs label:has(:checked){outline:2px solid #f3db9c}
.m4-order-feedback,.m4-proof-feedback,.m4-lab-result{display:block;min-height:24px;color:#f9e7c0;margin:11px 0 0;line-height:1.5}
.m4-order-feedback[data-correct=yes],.m4-proof-feedback[data-correct=yes]{color:#bff0d4}
.m4-fields{display:flex;gap:12px;flex-wrap:wrap;margin:12px 0}.m4-fields label{display:flex;flex-direction:column;gap:6px;flex:1;min-width:140px}.m4-fields label:has(input[type=radio]){flex-direction:row;align-items:start}
.m4-fields input[type=number]{width:100%;border:1px solid #789ca3;border-radius:8px;background:#f7fbfa;color:#132c36;padding:9px;font-size:1rem}
.m4-reflect textarea{display:block;width:100%;box-sizing:border-box;background:#f9f9f5;color:#102d38;border:1px solid #73979c;border-radius:9px;min-height:75px;padding:10px;font:inherit;margin:10px 0}
.m4-reflect small{display:block;color:#d4e2dc}
.m4-workshop :is(button,input,textarea):focus-visible{outline:3px solid #fff0a9;outline-offset:3px}
@media(max-width:600px){.m4-sort li{align-items:flex-start}.m4-fields{display:grid;grid-template-columns:1fr}.m4-fields label{min-width:0}}
@media print{.m4-sort-controls,.m4-workshop button,.m4-lab{display:none}}

/* МИСИАРИУМ 4.1 · Блокове за реални алгоритми в 4. клас */
.l41-puzzle{border:1px solid rgba(94,138,203,.35);border-radius:20px;padding:1.1rem;margin:1rem 0;background:linear-gradient(145deg,rgba(74,126,192,.10),rgba(101,183,151,.07))}
.l41-puzzle h4{margin:.2rem 0 .7rem}
.l41-blocks{display:grid;gap:.55rem;padding-left:0;list-style:none}
.l41-blocks>li{background:#f0f8f5;color:#16353b;border:1px solid rgba(80,125,169,.32);border-radius:12px;padding:.65rem;display:flex;align-items:center;justify-content:space-between;gap:.6rem}
.l41-controls{white-space:nowrap;display:inline-flex;gap:.35rem}
.l41-controls button{min-width:2.5rem;min-height:2.5rem;cursor:pointer;border-radius:10px}
.l41-controls button:disabled{cursor:default;opacity:.35}
.l41-puzzle .l41-result{min-height:1.6em;font-weight:700}
.l41-puzzle .l41-result[data-correct="yes"]{color:#226e4d}
.l41-puzzle .l41-result[data-correct="no"]{color:#985821}
.l41-puzzle .l41-trace{padding:.7rem;border-radius:10px;border:1px solid rgba(74,150,105,.4)}
.l41-puzzle small{display:block;line-height:1.4;opacity:.8;margin-top:.6rem}
@media print{.l41-controls,.l41-check{display:none!important}}
/* 4.3.0: preserve line breaks in lesson-specific traced code; readable feedback on dark cards. */
.l41-puzzle .l41-trace{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65}
.l41-puzzle .l41-result[data-correct="yes"]{color:#b9f5d2}
.l41-puzzle .l41-result[data-correct="no"]{color:#ffd6a0}

/* Misiarium 4.5: learner-owned Python editor, no server execution */
.l450-python{margin:1.3rem 0;padding:1.1rem;border:1px solid #88b8d6;border-radius:16px;background:linear-gradient(150deg,#10283f 0%,#17394c 100%);color:#f5fbff}
.l450-python-head{display:flex;justify-content:space-between;flex-wrap:wrap;gap:.5rem;align-items:center;margin-bottom:.65rem}
.l450-python-head strong{font-size:1.12rem;color:#f9e5a4}.l450-python-head span{font-size:.8rem;opacity:.9}
.l450-python p{line-height:1.6}.l450-python code{color:#d7f3ef}.l450-editor-label{display:block;font-weight:700;margin:.8rem 0 .4rem}
.l450-code{display:block;width:100%;box-sizing:border-box;min-height:180px;padding:.85rem;color:#f3f5fb;background:#071725;border:1px solid #7197ac;border-radius:10px;font:15px/1.55 ui-monospace,SFMono-Regular,Consolas,Monaco,monospace;tab-size:4;white-space:pre;resize:vertical}
.l450-code-actions{display:flex;flex-wrap:wrap;gap:.5rem;margin:.65rem 0}
.l450-code-actions button{padding:.65rem .85rem;border:1px solid #8bacc9;border-radius:9px;font-weight:700;background:#daeafa;color:#152d46;cursor:pointer;min-height:44px}
.l450-code-actions button:disabled{opacity:.6;cursor:wait}
.l450-results{min-height:68px;max-height:230px;overflow:auto;white-space:pre-wrap;word-break:break-word;padding:.8rem;background:#061726;color:#f5fbff;border:1px solid #45697f;border-radius:9px;font:13px/1.55 ui-monospace,Consolas,monospace}
.l450-python .l450-privacy{font-size:.78rem;opacity:.86;margin-top:.75rem}
@media(max-width:600px){.l450-python{padding:.7rem}.l450-code-actions button{flex:1 1 100%}.l450-code{font-size:14px}}
