.academy-editor{border:1px solid var(--academy-line, #2b4056);border-radius:16px;background:var(--academy-input, #0c1928);overflow:hidden;min-width:0;color:var(--academy-text, #e8f0f8)}
.academy-editor-toolbar,.academy-editor-symbols{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:9px;background:var(--academy-raised, #182a3d);border-bottom:1px solid var(--academy-line, #2b4056)}
.academy-editor button{color:var(--academy-text, #e8f0f8);background:var(--academy-surface, #111f30);border:1px solid var(--academy-control, #647d94);border-radius:10px;min-width:44px;min-height:44px;padding:4px 9px;font-size:14px;line-height:1.5}
.academy-editor button:focus-visible,.academy-editor summary:focus-visible{outline:3px solid var(--academy-focus, #7ac8ff);outline-offset:2px}
.academy-editor .CodeMirror{height:390px;font-family:Consolas,'Courier New',monospace;line-height:1.65;text-align:left;direction:ltr;background:var(--academy-input, #0c1928);color:var(--academy-text, #e8f0f8)}
.academy-editor .CodeMirror pre.CodeMirror-line,.academy-editor .CodeMirror pre.CodeMirror-line-like{font-family:inherit;font-size:inherit;line-height:inherit}
.academy-editor .CodeMirror-gutters{background:var(--academy-surface, #111f30);border-right:1px solid var(--academy-line, #2b4056)}
.academy-editor .CodeMirror-linenumber{color:var(--academy-muted, #a4b7cb)}
.academy-editor .CodeMirror-activeline-background{background:var(--academy-raised, #182a3d)}
.academy-editor .CodeMirror-cursor{border-left:2px solid var(--academy-accent, #62dfba)}
.academy-editor .cm-keyword{color:var(--academy-syntax-keyword, #c4a7ff);font-weight:600}.academy-editor .cm-number{color:var(--academy-warning, #f5d18b)}.academy-editor .cm-string{color:var(--academy-syntax-string, #8de2bc)}.academy-editor .cm-comment{color:var(--academy-muted, #a4b7cb);font-style:italic}.academy-editor .cm-meta{color:var(--academy-syntax-meta, #f2a9ce)}.academy-editor .cm-def{color:var(--academy-info, #9bc7ff)}.academy-editor .cm-builtin{color:var(--academy-syntax-builtin, #7fd7ed)}.academy-editor .cm-operator{color:var(--academy-syntax-operator, #f2bc94)}
.academy-editor .CodeMirror-matchingbracket{color:var(--academy-success, #7be0ad)!important;background:var(--academy-success-bg, #17392e);font-weight:bold}.academy-editor .CodeMirror-nonmatchingbracket{color:var(--academy-danger, #ff9a9f)!important;background:var(--academy-danger-bg, #3f2230)}
.academy-editor .CodeMirror-selected{background:var(--academy-editor-selection, #243d54)}.academy-editor .CodeMirror-focused .CodeMirror-selected{background:var(--academy-editor-selection-focus, #2b4761)}
.academy-editor .CodeMirror-dialog{padding:8px 10px;background:var(--academy-raised, #182a3d);color:var(--academy-text, #e8f0f8);font-family:Sarabun,sans-serif;font-size:14px;line-height:1.7}
.academy-editor .CodeMirror-dialog input{display:inline-block;max-width:100%;width:190px;background:var(--academy-input, #0c1928);border:1px solid var(--academy-control, #647d94);padding:8px;min-height:44px;border-radius:10px;color:var(--academy-text, #e8f0f8);font-family:inherit}
.academy-editor .cm-searching{background:var(--academy-warning, #f5d18b);color:var(--academy-accent-ink, #082b20)}
.academy-editor-help{padding:8px 12px;font-size:14px;border-top:1px solid var(--academy-line, #2b4056)}.academy-editor-help summary{cursor:pointer}.academy-editor-help p{margin:8px 0;line-height:1.8}
.editor-font-label{font-size:14px;color:var(--academy-muted, #a4b7cb);min-width:38px;text-align:center}.academy-editor .editor-exit{margin:4px 12px 10px;font-size:14px}
.academy-editor.is-expanded{position:fixed;inset:12px;z-index:500;display:flex;flex-direction:column;box-shadow:0 0 0 20px #030a1480,0 15px 50px #030a14aa}
.academy-editor.is-expanded .CodeMirror{flex:1;min-height:100px;height:auto}.academy-editor.is-expanded .academy-editor-toolbar,.academy-editor.is-expanded .academy-editor-symbols,.academy-editor.is-expanded .academy-editor-help{flex-shrink:0}
.academy-editor-symbols{border-top:1px solid var(--academy-line, #2b4056);border-bottom:0;background:var(--academy-surface, #111f30)}.academy-editor-symbols button{min-width:44px;font-family:Consolas,monospace}
.student-progress-topics{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px;padding:16px}.student-progress-topics .progress-topic{margin:0;border:1px solid var(--academy-line, #2b4056);border-radius:10px;padding:14px}
@media(max-width:600px){.academy-editor .CodeMirror{height:350px}.academy-editor-toolbar{gap:5px;padding:7px}.academy-editor.is-expanded{inset:4px}.academy-editor-help{font-size:14px}.academy-editor-symbols{gap:4px}.student-progress-topics{grid-template-columns:1fr}}

/* Cover every default CodeMirror token so no light-theme ink remains. */
.academy-editor .cm-atom,.academy-editor .cm-type{color:var(--academy-syntax-builtin, #7fd7ed)}
.academy-editor .cm-bracket,.academy-editor .cm-variable,.academy-editor .cm-property{color:var(--academy-text, #e8f0f8)}
.academy-editor .cm-variable-2,.academy-editor .cm-variable-3,.academy-editor .cm-qualifier,.academy-editor .cm-attribute,.academy-editor .cm-tag{color:var(--academy-info, #9bc7ff)}
.academy-editor .cm-string-2,.academy-editor .cm-quote{color:var(--academy-syntax-string, #8de2bc)}
.academy-editor .cm-hr{color:var(--academy-muted, #a4b7cb)}
.academy-editor .cm-header,.academy-editor .cm-link{color:var(--academy-focus, #7ac8ff)}
.academy-editor .cm-error,.academy-editor .cm-invalidchar{color:var(--academy-danger, #ff9a9f);background:var(--academy-danger-bg, #3f2230)}
.academy-editor .CodeMirror-lines{padding:8px 0}.academy-editor .CodeMirror-scrollbar-filler,.academy-editor .CodeMirror-gutter-filler{background:var(--academy-surface, #111f30)}
.academy-editor .CodeMirror-gutters,.academy-editor .CodeMirror{color-scheme:dark}
.academy-editor .CodeMirror-secondarycursor{border-left-color:var(--academy-muted, #a4b7cb)}
.academy-editor button:hover{background:var(--academy-raised, #182a3d);border-color:var(--academy-muted, #a4b7cb)}
.academy-editor .editor-exit{color:var(--academy-accent, #62dfba);min-height:44px}
.academy-editor summary{min-height:44px;align-content:center;color:var(--academy-muted, #a4b7cb)}
.student-progress-topics .progress-topic{background:var(--academy-input, #0c1928);color:var(--academy-text, #e8f0f8);border-radius:16px}

.academy-editor .CodeMirror .cm-searching{color:var(--academy-accent-ink, #082b20);background:var(--academy-warning, #f5d18b)}
.academy-editor:focus-within{border-color:var(--academy-focus, #7ac8ff)}
.academy-editor .CodeMirror-dialog input:focus-visible{outline:2px solid var(--academy-focus, #7ac8ff);outline-offset:2px}
