/* V1's level groups and accordion rhythm, scoped to the V2 theory reader. */
#panel-theory>.prose{padding:32px 40px}#theory-introduction{max-width:760px}.theory-index{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;padding:20px;background:#f8f6fd;border-radius:10px;margin:26px 0 36px}.theory-index strong{display:block;margin-bottom:9px}.theory-index button{display:block;text-align:left;border:0;background:none;padding:7px 0;color:#5145a7;font-weight:500;line-height:1.5;font-size:13px;min-height:40px}.theory-group{--level:#3576d6;--wash:#eef6ff;margin:32px 0}.theory-group.berekenen{--level:#b37b00;--wash:#fff9e8}.theory-group.toepassen{--level:#a65a24;--wash:#fff4ea}.theory-group.analyseren{--level:#754aba;--wash:#f6f0ff}.theory-group>h2{margin:0;border-left:4px solid var(--level);padding:16px 20px 0;background:var(--wash);border-radius:6px 6px 0 0}.theory-group>p{margin:0 0 20px!important;border-left:4px solid var(--level);padding:3px 20px 16px;background:var(--wash);font-size:14px}.prose details.lesson{padding:0;margin:16px 0;border:1px solid #d5dce7;border-radius:10px;overflow:clip;scroll-margin-top:100px}.prose .lesson>summary{padding:20px 24px;background:#f8fafc;font-weight:600;line-height:1.5}.lesson-title{display:inline;margin:0;font-size:17px}.lesson-subtitle{display:block;color:#526071;font-size:14px;font-weight:400;margin:5px 0 0 18px}.lesson[open]>summary{background:var(--wash);border-bottom:1px solid #d5dce7}.lesson-body{padding:28px 32px;max-width:920px;margin:auto}.lesson-body h4{font-size:19px;line-height:1.4;margin:22px 0 12px}.lesson-body h4:first-child{margin-top:0}.lesson-body h5{font-size:16px;line-height:1.5;margin:0 0 8px}.lesson-body p{margin:12px 0!important}.lesson-text{font-size:16px;line-height:1.8}.lesson-text>p{max-width:760px}.lesson-formula{padding:14px 20px;background:#f5f7fc;border-radius:8px;margin:20px 0;overflow-x:auto}.lesson-callout{border-left:3px solid var(--level);padding:16px 20px;background:var(--wash);border-radius:5px;margin:22px 0}.lesson-table{overflow-x:auto;margin:20px 0}.lesson-table table{border-collapse:collapse;width:100%;font-size:14px}.lesson-table caption{text-align:left;font-weight:600;margin-bottom:8px}.lesson-table th,.lesson-table td{border:1px solid #ccd6e4;padding:12px;text-align:left;vertical-align:top}.lesson-table th{background:#f1f5fa}.lesson-assessment,.lesson-worked,.lesson-reflection{border-top:1px solid #dce3eb;margin-top:30px;padding-top:28px}.lesson-assessment.check{background:#f8fafc;border:1px solid #dce3eb;border-radius:10px;padding:22px}.lesson-prompt{font-weight:600}.lesson-body .muted{font-size:14px}.lesson-body .button-row{margin:16px 0}.lesson-body textarea{width:100%;font:inherit;border:1px solid #aebac9;border-radius:8px;padding:12px;resize:vertical;min-height:100px;line-height:1.6;display:block;margin-bottom:14px}.lesson-model,.lesson-conclusion{padding:16px 20px;background:#eef7f1;border-left:3px solid #32814e;border-radius:6px;margin:18px 0}.example-steps{padding-left:25px;margin:20px 0}.example-steps>li{padding:5px 0 14px 12px}.example-steps>li::marker{font-weight:700;color:var(--purple)}.example-steps>li+li{border-top:1px solid #e1e7ee;padding-top:16px}.lesson-help{margin:18px 0;padding:18px;background:#fff8e8;border:1px solid #e5bc59;border-radius:8px}.lesson-help h5{margin:0}.lesson-help p{white-space:pre-wrap}.lesson-target{margin:20px 0 14px}.lesson-target select{width:100%}.lesson-return{margin-top:28px}.prose details.lesson-tip{padding:0;border:0;margin:16px 0}.lesson-tip summary{font-size:14px;color:var(--purple)}.lesson-tip p{font-size:14px}.number-field{margin-bottom:16px}.related-theory{margin-top:20px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}.related-theory button{border:0;background:#f4f1fc;color:#5145a7;font-size:13px;text-align:left;padding:8px 12px}.related-theory span{font-size:13px}.learning-path button{margin-top:10px;color:#5145a7;background:white;font-size:13px;padding:8px 10px}.lesson-body mjx-container[display=true]{max-width:100%;overflow-x:auto;overflow-y:hidden;padding:5px 0}.lesson-body :focus-visible{outline-offset:3px}
@media(max-width:800px){#panel-theory>.prose{padding:20px 16px}.theory-index{grid-template-columns:1fr 1fr;padding:16px;gap:16px 12px;margin-bottom:24px}.lesson-body{padding:22px 18px}.prose .lesson>summary{padding:18px}.lesson-title{font-size:16px}.lesson-subtitle{font-size:13px}.lesson-body h4{font-size:18px}.lesson-text{font-size:15px}.lesson-assessment.check{padding:16px}.lesson-formula{padding:10px}.lesson-body .button-row{gap:8px}.lesson-body button{max-width:100%;white-space:normal}.lesson-table th,.lesson-table td{padding:8px;min-width:95px}.prose details.lesson{scroll-margin-top:140px}.lesson-body mjx-container{font-size:100%!important}.example-steps>li{padding-left:4px}}
@media(max-width:430px){.theory-index{grid-template-columns:1fr}.theory-index div+div{border-top:1px solid #ddd5ed;padding-top:12px}.theory-index button{min-height:44px}.lesson-body{padding:20px 14px}.lesson-subtitle{margin-left:0}.lesson-body .button-row>*{flex:1 1 100%}}

.lesson-figure { max-width:36rem; margin:22px 0; }
.lesson-figure .question-representation { margin-bottom:.5rem; }
.lesson-figure-explanation { padding:10px 14px; border-left:3px solid var(--purple); background:#f8f6fd; font-size:.94em; line-height:1.65; }
@media print { .lesson-figure { break-inside:avoid; } }

/* Shared theory reader: contents and one selected lesson or worked path. */
#panel-theory.theory-explorer-page > .prose { padding:28px; }
.theory-explorer-page #theory-title { font-size:28px; line-height:1.3; margin:6px 0 10px; }
.theory-explorer-page #theory-introduction { font-size:14px; margin-bottom:22px; }
.theory-toolbar { position:sticky; top:80px; z-index:4; background:white; display:flex; align-items:center; gap:16px; padding:14px 0; border-top:1px solid #e8e5ef; border-bottom:1px solid #e8e5ef; margin-bottom:24px; }
.theory-location { flex:1; min-width:0; font-size:13px; color:#536176; margin:0; }
.theory-back { flex-shrink:0; font-size:13px; color:#584297; padding:9px 13px; }
.theory-menu-toggle,.theory-menu-close { display:none; }
.theory-explorer { display:grid; grid-template-columns:250px minmax(0,1fr); gap:26px; align-items:start; }
.theory-sidebar { position:sticky; top:170px; max-height:calc(100dvh - 190px); overflow:auto; padding:0 14px 12px 0; scrollbar-width:thin; }
.theory-sidebar-heading { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:16px; }
.theory-sidebar-heading h2 { font-size:16px; margin:0; }
.theory-explorer-page .theory-nav-group { border:0; border-radius:8px; padding:0; margin:5px 0; --level:#3576d6; --wash:#edf5ff; }
.theory-explorer-page .berekenen { --level:#966700; --wash:#fff8e4; }
.theory-explorer-page .toepassen { --level:#a65a24; --wash:#fff4ea; }
.theory-explorer-page .analyseren { --level:#754aba; --wash:#f6f0ff; }
.theory-explorer-page .theory-nav-group.steps { --level:#6f42c1; --wash:#f5f0fc; border-top:1px solid #ddd6e8; padding-top:17px; margin-top:18px; border-radius:0; }
.theory-explorer-page .theory-nav-group > summary { display:flex; align-items:center; gap:8px; min-height:44px; padding:7px 5px; font-size:13px; list-style:none; cursor:pointer; }
.theory-nav-group > summary::-webkit-details-marker { display:none; }
.theory-nav-group > summary::after { content:'›'; font-size:20px; transform:rotate(0deg); color:#677185; }
.theory-nav-group[open] > summary::after { transform:rotate(90deg); }
.theory-skill-icon { display:grid; place-items:center; width:23px; height:23px; border-radius:50%; flex-shrink:0; background:var(--wash); color:var(--level); font-size:11px; font-weight:700; }
.theory-nav-count { margin-left:auto; font-size:11px; color:#6c7483; font-weight:400; }
.theory-nav-group ul { list-style:none; padding:0 0 5px 12px; margin:0; }
.theory-nav-group li { margin:0; }
.theory-nav-group li button { display:block; width:100%; min-height:44px; border:0; border-left:3px solid transparent; border-radius:0 6px 6px 0; background:transparent; text-align:left; padding:9px 9px 9px 12px; font-size:12px; line-height:1.55; font-weight:400; color:#526071; }
.theory-nav-group li button:hover { background:#f7f6fa; }
.theory-nav-group li button[aria-current=page] { background:var(--wash); border-left-color:var(--level); color:#252d3c; font-weight:650; }
.theory-reader { min-width:0; }
.theory-explorer-page .theory-index,.theory-explorer-page .theory-group > h2,.theory-explorer-page .theory-group > p,.theory-explorer-page > .prose > [data-practice] { display:none; }
.theory-explorer-page .theory-group { margin:0; }
.theory-explorer-page article.lesson { border:1px solid #e0e2ea; border-radius:12px; overflow:clip; scroll-margin-top:174px; }
.theory-explorer-page .lesson > header { padding:20px 24px; background:var(--wash); border-bottom:1px solid #e9e3cf; }
.theory-explorer-page .lesson-skill { color:var(--level); font-size:12px; font-weight:650; margin:0 0 5px; }
.theory-explorer-page .lesson-title { display:block; font-size:23px; line-height:1.35; scroll-margin-top:190px; }
.theory-explorer-page .lesson-title:focus { outline:none; }
.theory-explorer-page .lesson-subtitle { margin:6px 0 0; font-size:13px; }
.theory-explorer-page .lesson-body { padding:24px; }
.theory-explorer-page .lesson-text { font-size:15px; line-height:1.75; }
.theory-explorer-page .lesson-body h4 { font-size:17px; }
.theory-explorer-page .lesson-assessment.check { background:#f3f7ff; border-color:#dce6f7; margin-top:24px; }
.theory-explorer-page details.lesson-worked { background:#f8f5fe; border:1px solid #e5dff3; border-radius:9px; padding:12px 16px; margin:24px 0; }
.theory-explorer-page details.lesson-worked > summary { color:#574187; font-size:15px; min-height:32px; cursor:pointer; }
.theory-explorer-page .lesson-assessment.practice { background:#f4f9f6; border:1px solid #dce8df; border-radius:9px; padding:20px; margin-top:24px; }
.theory-explorer-page .lesson-guided { margin:8px 0 0 8px; color:#5e4398; border-color:#d5c8e9; }
.theory-explorer-page .lesson-assessment.practice > .primary { margin-top:8px; }
.theory-explorer-page .lesson-return { font-size:13px; }
.theory-explorer-page #worked-examples { margin:0; padding:22px; scroll-margin-top:174px; }
.theory-explorer-page #worked-examples > h2 { font-size:22px; margin:0 0 8px; }
.theory-explorer-page #worked-examples > .button-row { display:none; }
.theory-explorer-page #worked-examples > .muted { font-size:14px; }
.theory-explorer-page .learning-example-title { scroll-margin-top:190px; font-size:20px; line-height:1.45; }
.theory-explorer-page .learning-section-top { flex-wrap:wrap; }
.theory-explorer-page .learning-levels { display:grid; grid-template-columns:1fr 1fr; }
.theory-welcome { padding:32px; background:#faf9fd; border:1px solid #e5dfee; border-radius:12px; }
.theory-welcome h2 { font-size:23px; }
.theory-drawer:not([open]) { display:none; }
@media(max-width:1050px) and (min-width:801px) {
  .theory-explorer { grid-template-columns:220px minmax(0,1fr); gap:18px; }
  #panel-theory.theory-explorer-page > .prose { padding:22px; }
  .theory-explorer-page .lesson-body { padding:20px; }
}
@media(max-width:800px) {
  #panel-theory.theory-explorer-page > .prose { padding:16px; }
  .theory-explorer-page #theory-title { font-size:23px; }
  .theory-toolbar { top:114px; flex-wrap:wrap; gap:10px; margin-bottom:18px; }
  .theory-menu-toggle,.theory-menu-close { display:block; font-size:13px; padding:9px 11px; }
  .theory-menu-toggle { color:#594199; background:#f5f1fc; border-color:#d6cce7; }
  .theory-back { margin-left:auto; font-size:12px; padding:9px; }
  .theory-location { flex-basis:100%; order:3; line-height:1.5; }
  .theory-explorer { display:block; }
  .theory-explorer-page .lesson > header { padding:17px; }
  .theory-explorer-page .lesson-title { font-size:20px; scroll-margin-top:255px; }
  .theory-explorer-page .lesson-body { padding:16px; }
  .theory-explorer-page .lesson-assessment.check,.theory-explorer-page .lesson-assessment.practice { padding:14px; }
  .theory-explorer-page .lesson-guided { margin:8px 0 0; width:100%; }
  .theory-explorer-page .lesson-assessment.practice > .primary { width:100%; }
  .theory-explorer-page article.lesson,.theory-explorer-page #worked-examples { scroll-margin-top:260px; }
  .theory-explorer-page #worked-examples { padding:16px; }
  .theory-explorer-page .learning-example-title { scroll-margin-top:255px; }
  .theory-drawer { margin:0; width:min(360px,92vw); height:100dvh; max-height:100dvh; max-width:92vw; border:0; border-radius:0 14px 14px 0; padding:22px 18px; }
  .theory-drawer::backdrop { background:#20233473; backdrop-filter:blur(2px); }
  .theory-drawer .theory-sidebar { position:static; max-height:none; padding:0; overflow:visible; }
  .theory-drawer .theory-sidebar-heading h2 { font-size:18px; text-align:left; margin:0; }
  .theory-drawer .theory-sidebar-heading { position:sticky; top:0; z-index:1; background:white; padding:8px 0; border-bottom:1px solid #e8e5ef; }
  .theory-drawer .theory-nav-group li button { font-size:14px; }
}
@media print { .theory-toolbar,.theory-sidebar,.theory-drawer { display:none!important; } .theory-explorer { display:block; } }
@media(max-width:430px) {
  .theory-explorer-page .lesson-construction details.lesson-worked { padding:12px 8px; }
  .lesson-construction .lesson-conclusion { padding:12px 8px; }
  .lesson-construction .lesson-conclusion .scene-label { font-size:28px; }
}
