/* Theory view inherits original app design tokens and header. */
.theoryWrap{max-width:1040px;margin:0 auto;padding:26px 24px 64px;position:relative}
.theoryHome{margin-left:auto;text-decoration:none;color:var(--ink);font-weight:700;font-size:13px}
.theoryTop{display:flex;justify-content:space-between;gap:20px;align-items:center}
.theoryTop small,.theoryKicker{font-size:11px;font-weight:800;letter-spacing:.13em;color:var(--muted)}
.theoryTop h1{font-size:clamp(34px,5vw,48px);margin:10px 0 8px;line-height:1.12}
.theoryTop p{margin:0;color:var(--muted);font-size:14px}
.theoryStats{margin:20px 0;color:var(--muted);font-size:13px}
.languageSwitch{display:flex;border:1px solid var(--line);border-radius:999px;padding:3px;flex:0 0 auto}
.languageSwitch button{min-width:46px;padding:8px 12px;background:transparent;color:inherit;border:0;border-radius:999px;cursor:pointer;font-weight:800}
.languageSwitch button[aria-pressed=true]{background:var(--accent-soft);color:var(--ink)}
.theoryNav{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:26px}
.theoryNav button,.theoryPanel button{font:inherit;font-size:13px;font-weight:750;border:1px solid var(--line);padding:11px 17px;cursor:pointer}
.theoryNav button{background:var(--accent-pale);color:var(--ink);border-radius:999px}
.theorySelector{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px;margin-bottom:14px;color:var(--muted);font-size:13px}
.theorySelector select{margin-left:6px;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--paper-solid);color:var(--ink);max-width:90vw}
.theoryPanel{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-soft);padding:clamp(22px,4vw,42px);min-height:260px}
.theoryPanel h2{font-size:clamp(23px,3.5vw,32px);line-height:1.25;margin:12px 0 18px}
.theoryPanel p{max-width:75ch;line-height:1.7}
.theoryTip,.theoryFeedback{background:var(--accent-pale);border-left:3px solid var(--focus);padding:15px 18px;margin:22px 0;border-radius:8px}
.theoryPanel button{background:var(--ink);color:white;border-radius:12px;margin:12px 10px 0 0}
.theoryPanel button:disabled{opacity:.46;cursor:not-allowed}
.theoryPanel input:not([type=radio]){display:block;font:inherit;font-size:16px;max-width:100%;width:460px;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--paper-solid);color:var(--ink)}
.choice{display:block;padding:12px;margin:8px 0;border:1px solid var(--line);border-radius:10px;cursor:pointer}.choice input{margin-right:12px;accent-color:var(--focus)}
.topicRow{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}.topicRow button{background:none;color:var(--ink);border:0;margin:0;padding:4px;text-align:left}.topicRow span{font-size:12px;color:var(--muted)}
.theoryNote{font-size:12px;color:var(--muted);margin-top:24px}.staff{width:min(100%,370px);display:block;margin:16px 0}
@media(max-width:580px){.theoryWrap{padding:18px 15px 50px}.theoryTop{align-items:flex-start}.theoryPanel{padding:20px}.topicRow{align-items:flex-start;flex-direction:column}.theoryNav button{flex:1 1 auto}}
body{background:linear-gradient(180deg,#f8fbff,var(--bg))}.theoryTop h1,.theoryPanel h2{font-family:Georgia,"Times New Roman",serif;font-weight:500}.theoryHome{color:var(--ink)}.theoryPanel button:hover{background:var(--ink-2)}

/* Integrated main tabs and fixed English/French parallel reading */
.theoryPageShell{max-width:1100px;margin:0 auto;padding:0 20px}
.theoryPageShell .sectionTabs{margin-top:20px;margin-bottom:0}
.theorySectionTabs a.theoryActive{font-weight:900;box-shadow:inset 0 -3px 0 currentColor}
.theoryWrap{padding-top:26px}
.theoryEnglish,.theoryFrench{display:block}
.theoryFrench{margin-top:7px;opacity:.82;font-size:.92em;line-height:1.5}
.theoryPanel h2 .theoryFrench{font-size:.76em;font-weight:normal}
.theoryTip .theoryFrench{margin-top:9px}
@media(max-width:580px){.theoryPageShell{padding:0 12px}.theoryPageShell .sectionTabs{display:flex;flex-wrap:wrap;gap:4px}.theoryPageShell .sectionTabs a{font-size:12px}.theoryWrap{padding-left:2px;padding-right:2px}}

/* Compact study sets, accessible high-contrast controls */
.theoryWrap{max-width:980px;padding-top:16px}.theoryTop h1{font-size:clamp(25px,3vw,36px)}.theoryStats{margin:10px 0 14px}.theoryNav{margin-bottom:16px}.theoryNav button[aria-pressed=true]{outline:2px solid var(--focus);outline-offset:2px}.theoryPanel{padding:clamp(20px,3vw,30px)}.theoryPanel h2{font-size:clamp(23px,2.8vw,29px)}.theoryPanel h3{font-size:clamp(17px,2.2vw,20px);margin:6px 0 10px}.learnUnit{padding:16px 0;border-bottom:1px solid var(--line)}.learnUnit:last-of-type{border-bottom:0}.learnUnit p{margin:8px 0}.learnUnit .theoryTip{margin:10px 0;padding:12px 15px}.theoryHelp{color:var(--muted);font-size:14px}.questionBlock{padding:20px 0;border-bottom:1px solid var(--line)}.questionLabel{font-size:12px;font-weight:800;color:var(--muted)}.questionBlock h3{line-height:1.4}.questionBlock .choiceGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-width:650px}.questionBlock .choice{margin:0}.questionBlock .theoryAnswer{width:min(100%,540px)}.answerDetail{margin:12px 0;padding:12px 16px;border-radius:8px;background:var(--accent-pale)}.answerDetail p{margin:6px 0}.answerRight{border-left:4px solid #2d9b76;padding-left:12px}.answerWrong{border-left:4px solid #dc7777;padding-left:12px}.batchSummary{padding:18px 0}.topicRow button{white-space:normal;overflow-wrap:anywhere;max-width:77%;width:auto;min-width:0;display:block;line-height:1.5;font-size:14px;font-weight:700}.topicRow{min-height:54px}.theoryFrench{opacity:1;color:var(--muted);font-size:.93em}.theoryPanel button{line-height:1.4}.theoryPanel button:focus-visible,.theoryNav button:focus-visible{outline:3px solid var(--focus);outline-offset:2px}@media(max-width:600px){.questionBlock .choiceGrid{grid-template-columns:1fr}.theoryPanel{padding:18px}.theoryNav button{padding:10px}.topicRow button{max-width:100%}}

.theoryPanel textarea.theoryAnswer{width:100%;min-height:110px;resize:vertical;padding:12px;font:inherit}.selfButtons{display:flex;gap:10px;flex-wrap:wrap}.theoryFrench{display:block;margin-top:5px;line-height:1.55}.theoryEnglish{display:block;line-height:1.55}.theoryPanel .learnUnit{padding-block:15px}.theoryPanel .questionBlock{padding-block:18px}

/* Accessible musical examples and low-friction multiple choice */
.theoryExample{margin:12px 0 3px;padding:14px 16px;border-radius:12px;background:var(--accent-pale);border-left:4px solid var(--focus);line-height:1.65}.theoryExample strong{font-size:13px}.theoryExample p{margin:8px 0 0}.theoryChoices{display:grid;gap:9px;margin-top:12px}.theoryChoice{display:flex;align-items:flex-start;gap:12px;padding:13px 15px;border-radius:11px;background:var(--accent-pale);border:1px solid var(--line);cursor:pointer;line-height:1.5}.theoryChoice input{width:18px;height:18px;flex-shrink:0;margin-top:4px;accent-color:var(--focus)}.theoryChoice:has(input:checked){outline:2px solid var(--focus);outline-offset:0}.theoryChoice .theoryFrench{margin-top:2px}.theoryChoice .theoryEnglish{font-weight:650}.theoryPanel select.theoryAnswer{min-height:45px;max-width:100%;background:var(--paper-solid);color:var(--ink);border:1px solid var(--line);border-radius:8px;padding:9px}@media(max-width:600px){.theoryChoice{padding:12px}.theoryExample{padding:12px}}

/* v7: streamlined learning surfaces; keep original app typography and palette */
.theoryWrap{padding-top:12px;padding-bottom:32px}
.theoryTop h1{font-size:clamp(24px,3vw,32px);margin:2px 0 3px;line-height:1.18}
.theoryTop p{font-size:13px;line-height:1.35}
.theoryNav{gap:6px;margin:12px 0}
.theoryNav button{padding:8px 12px;margin:0;font-size:13px}
.theoryPanel{padding:clamp(16px,2.4vw,24px);min-height:0}
.theoryPanel h2{font-size:clamp(21px,2.5vw,26px);margin:0 0 12px}
.theoryPanel h3{font-size:clamp(16px,2vw,19px);margin:3px 0 8px}
.theoryPanel p{line-height:1.5}
.theoryPanel .learnUnit{padding:12px 0}
.learnUnit p{margin:5px 0}
.theoryExample{margin:8px 0 2px;padding:10px 13px;line-height:1.5}
.theoryExample p{margin:0}
.theoryPanel .questionBlock{padding:13px 0}
.theoryChoices{gap:6px;margin-top:9px}
.theoryChoice{padding:9px 12px;line-height:1.4}
.theoryFrench{margin-top:3px;line-height:1.4}
.theoryEnglish{line-height:1.4}
.theoryPanel button{margin-top:10px;padding:9px 14px}
.answerDetail{padding:10px 12px;margin:8px 0}
.answerDetail p{margin:4px 0}
.batchSummary{padding:8px 0}
.theoryNote{margin:14px 0 0}
@media(max-width:600px){.theoryWrap{padding-top:9px}.theoryPanel{padding:15px}.theoryNav button{padding:8px 9px;font-size:12px}.theoryChoice{padding:9px 10px}}

/* Self-contained engraved notation for lesson examples */
.scoreExample{margin:10px 0 14px;border:1px solid var(--line);border-radius:12px;background:var(--paper-solid, #fff);padding:9px 11px;color:var(--ink)}
.scoreScroll{overflow-x:auto;overscroll-behavior-x:contain}.scoreScroll svg{display:block;min-width:340px;width:100%;height:auto;max-height:180px}
.scoreTools{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:4px 2px 0;font-size:12px;color:var(--muted);line-height:1.35}
.theoryPanel .scoreTools .scorePlay{margin:0;padding:7px 12px;border-radius:8px;font-size:12px;white-space:nowrap;min-height:34px}
.scoreTools span{flex:1;min-width:180px}
@media(max-width:600px){.scoreExample{padding:7px}.scoreTools{font-size:11px}.scoreScroll svg{width:max(100%,340px)}}
