.course-python-editor{--ce-bg:#fff;--ce-soft:#f8faff;--ce-line:#e1e7f1;--ce-ink:#21314a;--ce-muted:#71809a;min-width:0;max-width:100%;border:1px solid var(--ce-line);border-radius:14px;overflow:hidden;background:var(--ce-bg);color:var(--ce-ink);margin:18px 0 12px;box-shadow:0 4px 18px #1d31530a}
.course-code-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;background:var(--ce-soft);border-bottom:1px solid var(--ce-line)}
.course-code-head strong{display:flex;align-items:center;gap:9px;font-size:13px}.course-code-head strong span{display:grid;place-items:center;width:29px;height:29px;border-radius:8px;background:#e8edff;color:#4e62bd;font:600 12px monospace}
.course-code-head>div{display:flex;gap:6px}.course-python-editor button{padding:7px 12px;min-height:32px;border:1px solid var(--ce-line);border-radius:8px;font-family:inherit;font-weight:600;font-size:12px;line-height:1.3;cursor:pointer;background:var(--ce-bg);color:var(--ce-ink)}
.course-python-editor button[data-code-run],.course-python-editor button[data-code-send]{background:#4e62d4;color:#fff;border-color:#4e62d4}.course-python-editor button:disabled{opacity:.45;cursor:default}
.course-code-source{height:300px;min-height:140px;max-height:75vh;resize:vertical;overflow:auto;min-width:0;background:var(--ce-bg)}
.course-python-editor .course-code-source>textarea{display:block;width:100%;height:100%;min-height:140px;resize:none;border:0;border-radius:0;padding:14px;font:14px/1.7 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre;overflow:auto;background:var(--ce-bg);color:var(--ce-ink)}
.course-python-editor .CodeMirror{font:14px/1.7 ui-monospace,SFMono-Regular,Consolas,monospace;background:var(--ce-bg);color:var(--ce-ink);min-height:140px}.course-python-editor .CodeMirror-lines{padding:14px 0}.course-python-editor .CodeMirror-gutters{background:var(--ce-soft);border-color:var(--ce-line)}.course-python-editor .CodeMirror-linenumber{color:#92a0b9;padding-right:12px}
.course-code-files{padding:8px 14px;background:var(--ce-soft);border-top:1px solid var(--ce-line)}.course-code-files label{display:flex;align-items:center;flex-wrap:wrap;gap:10px;font-size:11px;color:var(--ce-muted)}.course-code-files input{font-size:11px;max-width:100%;width:auto}.course-code-files input::file-selector-button{padding:5px 9px;border:1px solid var(--ce-line);border-radius:6px;background:var(--ce-bg);color:var(--ce-ink);font:inherit}
.course-code-console-head{display:flex;align-items:center;gap:12px;padding:9px 14px;border-top:1px solid var(--ce-line);font-size:11px;background:var(--ce-soft)}.course-code-console-head span{font-size:11px;color:var(--ce-muted)}
.course-python-editor .course-code-output{min-height:90px;max-height:280px;overflow:auto;margin:0;border:0;border-radius:0;padding:14px;background:#172337;color:#d8e3f4;font:12px/1.7 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
.course-code-input{display:flex;align-items:center;gap:8px;padding:10px;background:#172337;border-top:1px solid #34425b}.course-code-input>span{color:#48d2ae;font:20px monospace}.course-python-editor .course-code-input input{flex:1;min-width:0;width:0;background:#202e45;border:1px solid #34425b;border-radius:7px;padding:8px 10px;color:#e4ecff;font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace}.course-code-input input::placeholder{color:#a8b7d0}.course-python-editor .course-code-note{margin:0;padding:10px 14px;background:var(--ce-soft);color:var(--ce-muted);font-size:11px;line-height:1.5}
html[data-theme=dark] .course-python-editor{--ce-bg:#192335;--ce-soft:#141e30;--ce-line:#34435c;--ce-ink:#e6edf9;--ce-muted:#a7b5cd}html[data-theme=dark] .course-python-editor .CodeMirror-cursor{border-color:#e6edf9}html[data-theme=dark] .course-python-editor .CodeMirror-selected{background:#3b4b72}html[data-theme=dark] .course-python-editor :is(.cm-keyword,.cm-atom){color:#c5a6ff}html[data-theme=dark] .course-python-editor .cm-string{color:#a2d5ae}html[data-theme=dark] .course-python-editor .cm-number{color:#f2bd85}html[data-theme=dark] .course-python-editor .cm-comment{color:#9cacc8}html[data-theme=dark] .course-python-editor :is(.cm-builtin,.cm-def){color:#a9c8ff}html[data-theme=dark] .course-python-editor :is(.cm-variable,.cm-variable-2,.cm-operator){color:#e6edf9}
@media(max-width:480px){.course-code-head{padding:9px 10px}.course-code-input{gap:5px}.course-code-input button{padding:7px;font-size:10px}.course-code-source{height:260px}.course-python-editor .CodeMirror{font-size:13px}.course-code-files label{font-size:10px}}
/* Keep the editor's controls independent of the site's general form styling. */
#app .course-python-editor .course-code-input input{background:#202e45!important;color:#e4ecff!important;font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace!important;border-color:#34425b;border-radius:7px;min-height:34px;padding:8px 10px}
#app .course-python-editor .course-code-files input{padding:0;min-height:0;border:0;background:transparent;border-radius:0;font-size:11px;font-weight:400;box-shadow:none}
html[data-theme=dark] #app .course-python-editor .course-code-input input{background:#202e45!important;color:#e4ecff!important;border-color:#34425b!important}
html[data-theme=dark] #app .course-python-editor .course-code-files input{background:transparent!important;border:0!important}
