:root{color-scheme:dark;font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;background:#10151e;color:#dce3ee}*{box-sizing:border-box}body{margin:0}.app{height:100dvh;min-height:540px;display:flex;flex-direction:column}.topbar{height:57px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #323b49;background:#202735;padding:0 17px;gap:12px}.brand{display:flex;align-items:center;gap:12px;white-space:nowrap}.brand-logo{font-weight:800;color:#74b8ff;font-size:18px}.brand-sub{color:#8191aa;font-size:12px}.actions{display:flex;align-items:center;gap:7px}button{background:transparent;border:1px solid transparent;border-radius:6px;color:#c9d4e5;padding:8px 11px;cursor:pointer;font:inherit;font-size:12px}button:hover:not(:disabled){background:#343e50}button:focus-visible,textarea:focus-visible{outline:2px solid #69aafb;outline-offset:1px}button:disabled{opacity:.48;cursor:not-allowed}.primary{background:#267bc9;color:white;border-color:#3890e4;font-weight:650}.primary:hover:not(:disabled){background:#368ce0}.primary small{font-size:10px;font-weight:400;opacity:.75;margin-left:6px}.separator{height:25px;width:1px;background:#465065;margin:0 4px}.stop{color:#f9b9b9}.workspace{display:flex;flex:1;min-height:0}.rail{width:49px;background:#1d2532;border-right:1px solid #303b4a;flex:none;padding-top:13px}.rail-item{height:47px;display:grid;place-items:center;color:#77859a;font-weight:800}.rail-item.active{color:#dbe6f5;border-left:2px solid #7ab6ff}.sidebar{width:214px;flex:none;background:#19212e;border-right:1px solid #323b49}.section-heading{font-size:10px;letter-spacing:1px;color:#94a4bb;padding:20px 20px 22px}.folder{padding:9px 16px;font-size:11px;font-weight:650;letter-spacing:.5px}.file-item{border:0;border-radius:0;width:100%;text-align:left;padding:11px 23px;color:#c8d4e5}.file-item.active{background:#253244}.sidebar-note{font-size:11px;color:#718099;line-height:1.6;padding:20px}.main{flex:1;display:flex;min-width:0;min-height:0;flex-direction:column}.tabs{height:41px;flex:none;display:flex;align-items:center;background:#1b2230;border-bottom:1px solid #343e4d}.tab{height:100%;display:flex;align-items:center;min-width:148px;padding:0 17px;background:#111821;border-right:1px solid #354052;font-size:12px}.spacer{flex:1}.status{margin-right:18px;font-size:11px;color:#f0c780}.status.ready{color:#80dca1}.status.error{color:#ff9f9f}.editor-area{flex:1;min-height:170px;position:relative;background:#111821}#editor,#fallbackEditor{height:100%;width:100%}#fallbackEditor{background:#111821;color:#e5ebf5;border:0;padding:20px;font:14px/1.6 Consolas,Monaco,monospace;resize:none;tab-size:4}.panel-header{height:35px;flex:none;background:#19212e;border-top:1px solid #354052;border-bottom:1px solid #354052;display:flex;align-items:center;justify-content:space-between;font-size:11px;font-weight:650;letter-spacing:.7px;padding:0 15px}.panel-header button{font-weight:400;letter-spacing:normal}.console-layout{height:214px;flex:none;display:flex;min-height:0;background:#111821}.console-main{flex:1;overflow:auto;padding:12px 17px;min-width:0}#output{margin:0;font:12.5px/1.65 Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere;color:#d7e5f5}.muted{color:#8c9aaf}.error-line{color:#fa9fa4}.success-line{color:#83dba3}.input-pane{width:265px;border-left:1px solid #343e4d;display:flex;flex-direction:column;padding:11px;gap:7px}.input-pane label{font-size:10px;letter-spacing:.4px;font-weight:750;color:#a6b6ca}.hint{font-weight:400;color:#788ba3;letter-spacing:0}.input-pane textarea{flex:1;min-height:0;width:100%;resize:none;background:#1b2534;border:1px solid #3c495b;border-radius:5px;color:#e0e9f5;padding:9px;font:12px/1.5 Consolas,monospace}.input-pane small{color:#8192a8;font-size:10px;line-height:1.45}.footer{height:24px;display:flex;align-items:center;justify-content:space-between;flex:none;background:#1765a8;color:#fff;font-size:10px;padding:0 12px}.footer-about{color:#fff;text-decoration:underline;text-underline-offset:2px;white-space:nowrap}.footer-about:focus-visible{outline:2px solid #fff;outline-offset:2px}@media(max-width:560px){.footer-about{display:none}}dialog{border:1px solid #485b75;background:#222d3c;color:#e8eef7;border-radius:12px;padding:24px;max-width:360px}dialog::backdrop{background:#0009}dialog p{font-size:13px;line-height:1.5;color:#aebdd0}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:22px}@media(max-width:850px){.sidebar{display:none}.brand-sub{display:none}.rail{width:37px}.topbar{padding:0 8px}.actions{gap:1px}.actions button{padding:8px 6px}.primary small{display:none}.input-pane{width:35%}}@media(max-width:560px){.brand{gap:5px}.brand strong{font-size:12px}.actions button{font-size:11px}.rail{display:none}.console-layout{height:240px;flex-direction:column}.input-pane{width:100%;height:112px;border-left:0;border-top:1px solid #343e4d;padding:8px}.input-pane small{display:none}.input-pane label{font-size:9px}.console-main{min-height:110px}.input-pane textarea{font-size:11px}.status{font-size:10px;margin-right:7px}}
#args{width:100%;min-height:31px;background:#1b2534;border:1px solid #3c495b;border-radius:5px;color:#e0e9f5;padding:7px;font:12px Consolas,monospace}#addFileBtn{margin:8px 12px;text-align:left;border:1px dashed #4f6076;width:calc(100% - 24px)}#fileList{max-height:40vh;overflow-y:auto}#testBtn{color:#9ee8bb}@media(max-width:560px){#testBtn{font-size:10px}#args{min-height:27px}}

[hidden]{display:none!important}#terminalPrompt{display:flex;gap:10px;align-items:center;padding:7px 0;color:#7ed6a1}#terminalInput{flex:1;background:transparent;color:#e6f3ff;border:0;border-bottom:1px solid #4d6680;outline:0;font:13px/1.6 Consolas,monospace;min-width:0}#terminalInput:focus{border-color:#78baff}.terminal-chevron{font-weight:750}.console-main{min-height:0}

.file-context-menu{position:fixed;z-index:999;background:#202b3b;border:1px solid #4a5c74;border-radius:8px;padding:5px;min-width:155px;box-shadow:0 8px 28px #0008}.file-context-menu button{display:block;width:100%;text-align:left;padding:9px 12px}.file-context-menu button[data-action=delete]{color:#f3a0a0}.folder-item{color:#e2c477}

#terminalPrompt{display:flex;align-items:center;gap:9px;white-space:nowrap}.terminal-chevron{font:12px Consolas,monospace;white-space:nowrap;flex:none;color:#87dfa5}#terminalInput{min-width:40px}.folder-item{text-align:left}.file-item{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}


/* Phase 1: VS Code-style layout enhancements */
.workspace{position:relative}
.rail-item{display:grid;place-items:center;width:100%;padding:0;border:0;border-radius:0;font-size:15px;background:transparent;cursor:pointer}
.rail button.rail-item:focus-visible{outline-offset:-3px}
.sidebar{display:flex;flex-direction:column}
.section-heading{display:flex;align-items:center;justify-content:space-between;padding:14px 12px 12px 17px;min-height:48px}
.explorer-actions{display:flex;align-items:center;gap:1px}
.explorer-actions button{font-size:18px;padding:4px 6px;line-height:1.1}
#fileList{flex:1;max-height:none;overflow:auto}
.sidebar-note{margin-top:auto;padding:14px}
.workspace.hide-sidebar .sidebar{display:none}
.open-tabs{display:flex;min-width:0;overflow-x:auto;scrollbar-width:thin;flex:1}
.tabs .spacer{flex:0 0 8px}
.tab{height:40px;min-width:95px;max-width:230px;padding:0 4px 0 10px;gap:3px;flex:none;align-items:center;background:#192231;border-right:1px solid #303b4a;border-bottom:1px solid transparent}
.tab.active{background:#111821;border-bottom:1px solid #7ab6ff}
.tab-label{display:block;flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:left;font-size:12px;padding:7px 5px}
.tab-close{flex:none;padding:3px 7px;font-size:17px;line-height:1;opacity:.6}
.tab:hover .tab-close,.tab.active .tab-close{opacity:1}
.panel-splitter{height:6px;flex:none;cursor:row-resize;background:#273241;border-top:1px solid #3c495b}
.panel-splitter:hover{background:#3a668f}
.panel-header .panel-actions{display:flex;align-items:center;gap:6px}
.panel-header #togglePanelBtn{font-size:16px;line-height:1;padding:2px 8px}
.main.panel-collapsed .console-layout{display:none}
.main.panel-collapsed .panel-splitter{display:none}
.footer{gap:12px}
.footer-editor{display:flex;gap:14px;margin-left:auto}
#saveStatus{color:#d6eeff}
.command-dialog{position:fixed;top:11vh;margin:0 auto;width:min(530px,94vw);max-width:none;max-height:70vh;padding:14px;background:#202a39;border:1px solid #63718a;box-shadow:0 22px 65px #000b}
.command-dialog label{font-size:12px;font-weight:650;color:#adbed4;display:block;margin-bottom:8px}
.command-dialog input{width:100%;font:14px Consolas,monospace;background:#121b29;color:#edf5ff;border:1px solid #61718b;padding:12px;border-radius:6px;outline-color:#75baff}
#commandResults{margin-top:9px;max-height:48vh;overflow:auto}
.palette-result{display:block;width:100%;text-align:left;font-size:13px;padding:10px;border-radius:5px}
.palette-result:hover,.palette-result:focus-visible{background:#324966}
#commandResults p{padding:8px 10px;font-size:13px;color:#8e9fb6}
@media(max-width:850px){
 .workspace .sidebar{display:none}
 .workspace.show-sidebar .sidebar{display:flex;position:absolute;left:37px;top:0;bottom:0;z-index:15;width:min(255px,calc(100vw - 45px));box-shadow:8px 0 25px #0008}
 .workspace.hide-sidebar .sidebar{display:none}
 #openBtn,#saveBtn,#downloadProjectBtn,#importProjectBtn,#testBtn{display:none}
 .actions{gap:3px}
 .footer-editor{gap:8px}
}
@media(max-width:560px){
 .rail{display:flex;width:37px;flex:none;flex-direction:column}
 .sidebar{width:220px}
 .app{min-height:0}
 .topbar{flex:none}
 .topbar .actions button{padding:6px}
 .console-layout{height:200px}
 .footer{font-size:9px;padding:0 7px}
 .footer-editor{gap:6px}
 #saveStatus{display:none}
 .tab{min-width:90px;max-width:150px}
}


/* Enhanced simulated terminal: keep the original pre/input as a CDN-failure fallback. */
.console-main.terminal-enhanced{overflow:hidden;padding:0;position:relative}
.console-main.terminal-enhanced #output,
.console-main.terminal-enhanced #terminalPrompt{display:none!important}
.browser-terminal{height:100%;width:100%;padding:7px 8px;overflow:hidden}
.browser-terminal .xterm{height:100%}
.browser-terminal .xterm-viewport{scrollbar-width:thin}
.browser-terminal .xterm-screen{cursor:text}


/* Phase 3 — diagnostics and test result panels */
.panel-title-tabs{display:flex;min-width:0;align-items:center;height:100%;gap:2px;overflow-x:auto;scrollbar-width:none}
.panel-title-tabs::-webkit-scrollbar{display:none}
.panel-header .panel-tab{border-radius:0;height:100%;padding:5px 13px;font-size:11px;letter-spacing:.3px;font-weight:650;white-space:nowrap;color:#8f9eb5;flex:none;border-bottom:2px solid transparent}
.panel-header .panel-tab.active{color:#e5f0ff;border-bottom-color:#79baff;background:#202d3c}
.panel-header .panel-tab:hover{background:#2d3a4a;color:#fff}
.panel-header .panel-tab span{font-size:10px;color:#ffadb0;margin-left:4px}
.panel-header .panel-actions{flex:none}
.analysis-view{display:none;flex:1;min-width:0;min-height:0;overflow:auto;padding:12px 15px;background:#111821}
.console-layout.show-problems .console-main,.console-layout.show-tests .console-main,
.console-layout.show-problems .input-pane,.console-layout.show-tests .input-pane{display:none!important}
.console-layout.show-problems #problemsView,.console-layout.show-tests #testsView{display:block}
.analysis-results{display:flex;flex-direction:column;gap:3px}
.analysis-result{display:flex;flex-direction:column;align-items:flex-start;text-align:left;width:100%;border:1px solid transparent;border-radius:4px;white-space:normal;gap:4px;padding:8px 10px;background:#1a2432;color:#d9e6f7;line-height:1.35}
.analysis-result:hover{background:#2c3d50;border-color:#4e6680}
.analysis-result strong{font-size:12px;font-weight:550}
.analysis-location{color:#93acc9;font:11px Consolas,monospace}
.problem-result strong,.test-result.failed strong,.test-result.error strong{color:#ffaeb5}
.test-result.passed strong{color:#8be0ae}
.test-result.skipped strong{color:#d9c38d}
.test-detail{color:#f2b9b9;font:11px/1.5 Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
.analysis-empty,.analysis-summary{font-size:12px;color:#a1b4cb;padding:10px;margin:0}
@media(max-width:560px){.panel-header .panel-tab{padding:6px 9px;font-size:10px}.panel-header #clearBtn{display:none}.analysis-view{padding:8px}}


/* Phase 4 — recorded trace debugger and classroom starter projects */
.console-layout.show-debug .console-main,.console-layout.show-debug .input-pane,
.console-layout.show-debug #problemsView,.console-layout.show-debug #testsView{display:none!important}
.console-layout.show-debug #debugView{display:block}
#debugView{padding:10px 14px}
.trace-controls{display:flex;gap:6px;flex-wrap:wrap;padding-bottom:7px}
.trace-controls button{padding:6px 10px;background:#273749;border:1px solid #425a73;font-size:11px}
.trace-controls button:disabled{opacity:.35}
.trace-frame-meta{color:#e8f3ff;font:600 12px Consolas,monospace;margin:5px 0}
.trace-hint{font-size:11px;color:#a0b4cf;line-height:1.4;margin:5px 0 10px}
.trace-columns{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.trace-section-title{display:block;font-size:10px;letter-spacing:.5px;color:#91adcd;margin-bottom:6px}
.trace-variable-list{display:flex;flex-direction:column;gap:4px;max-height:180px;overflow:auto}
.trace-variable{display:flex;flex-wrap:wrap;gap:6px 12px;justify-content:space-between;border-bottom:1px solid #354354;padding:4px 3px;font-size:11px}
.trace-variable strong{font-family:Consolas,monospace;font-weight:600;color:#bde3fa}
.trace-variable code{color:#d8e6fa;font:11px Consolas,monospace;overflow-wrap:anywhere}
.trace-output{font:11px/1.5 Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere;color:#dce9f7;max-height:180px;overflow:auto;margin:0;background:#0d1521;padding:8px;border:1px solid #334259;border-radius:4px}
.pl-breakpoint-glyph{background:#f05562;border-radius:50%;width:12px!important;height:12px!important;margin-left:3px;margin-top:3px;box-shadow:0 0 0 1px #0f1726}
.pl-current-trace-line{background:#294c684a}
.pl-trace-line-margin{background:#6eaee4}
#editor .margin-view-overlays{cursor:pointer}
.templates-dialog{max-width:min(540px,95vw);width:540px;max-height:80vh;overflow:auto}
.templates-dialog h3{margin:0 0 9px;font-size:18px}
.templates-dialog p{font-size:12px;color:#a5bad1;line-height:1.5}
.templates-dialog label{display:block;font-size:11px;font-weight:650;margin:12px 0 7px}
.templates-dialog textarea{width:100%;border-radius:6px;border:1px solid #526781;background:#111927;color:#e4f0ff;padding:9px;font:13px Consolas,monospace;resize:vertical}
.template-gallery{display:flex;flex-direction:column;gap:8px;margin:13px 0}
.template-choice{display:flex;flex-direction:column;text-align:left;align-items:flex-start;gap:6px;background:#172436;border:1px solid #405777;border-radius:7px;padding:12px}
.template-choice strong{font-size:13px;color:#dfecfc}
.template-choice span{color:#9eb8d0;font-size:12px}
@media(max-width:650px){.trace-columns{grid-template-columns:1fr}.trace-variable-list,.trace-output{max-height:140px}.panel-header .panel-tab{padding:5px 7px;font-size:10px}#templateBtn{display:none}}
@media(max-width:850px){#startTraceBtn{display:none}}


/* Phase 5 — multiple local projects and classroom submission */
.project-switcher{max-width:210px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:none;color:#d2e4f7;background:#142132;border:1px solid #506078;padding:6px 9px}
#currentProjectName{display:inline-block;max-width:130px;overflow:hidden;text-overflow:ellipsis;vertical-align:middle}
#projectTreeLabel{display:inline-block;max-width:176px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;vertical-align:bottom}
.project-manager-dialog{width:min(580px,95vw)}
.project-storage-status{font-size:11px!important;color:#c5d7ed!important}
.project-list{display:flex;flex-direction:column;gap:7px;margin:12px 0;max-height:42vh;overflow:auto}
.project-list-row{display:flex;align-items:center;gap:9px;padding:9px;background:#172333;border:1px solid #364960;border-radius:6px;min-width:0}
.project-list-row.active{border-color:#63abf9;background:#23344a}
.project-list-main{min-width:0;flex:1;display:flex;flex-direction:column;align-items:flex-start;text-align:left;padding:4px}
.project-list-main strong{font-size:13px;color:#e5f1ff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.project-list-main span{font-size:10px;color:#91a7c4;margin-top:4px}
.project-list-controls{display:flex;align-items:center;gap:2px;flex:none}
.project-list-controls button{font-size:11px;padding:6px 7px;border:1px solid #354960}
.project-list-controls .project-delete{color:#f2aab1}
.project-manager-dialog .dialog-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:15px}
.template-choice{width:100%}
.template-option{display:flex;align-items:stretch;gap:8px}
.template-option .template-choice{flex:1}
.template-option .template-link{flex:none;border:1px solid #466487;background:#21344b;max-width:155px;font-size:11px;align-self:stretch;padding:9px}
@media(max-width:950px){#downloadSubmissionBtn{display:none}#currentProjectName{max-width:90px}.project-switcher{max-width:150px}}
@media(max-width:650px){.brand-sub{display:none}.project-switcher{max-width:100px}#currentProjectName{max-width:65px}.topbar{padding:0 7px}.template-option{flex-direction:column}.project-list-row{flex-wrap:wrap}.project-list-controls{margin-left:auto}}


/* Native editor-style input for the simulated terminal.
   The transcript is selectable; only the current prompt is editable. */
.console-main.terminal-enhanced .browser-terminal{
 display:flex;flex-direction:column;gap:0;
 height:100%;min-height:0;padding:0;overflow:hidden;
 font-family:Consolas,Menlo,Monaco,monospace;
}
.terminal-history{
 flex:1;min-height:0;overflow:auto;
 padding:12px 16px 6px;
 white-space:pre-wrap;overflow-wrap:anywhere;
 font:14px/23px Consolas,Menlo,Monaco,monospace;
 color:#dce6f5;user-select:text;cursor:text;
 scrollbar-width:thin;
}
.terminal-history:focus-visible{outline:2px solid #6e9fdb;outline-offset:-2px}
.terminal-history .error-line{color:#ff9b9b}
.terminal-history .success-line{color:#83dba3}
.terminal-history .terminal-command{color:#e1ecfc}
.terminal-history .terminal-hints{color:#9eb4d1}
.terminal-entry{
 display:flex;align-items:flex-start;gap:7px;flex:none;
 min-height:43px;max-height:155px;
 padding:9px 16px 9px;
 background:#151f2b;border-top:1px solid #34455c;
}
.terminal-entry:focus-within{background:#18273a;border-top-color:#79b6ff}
.terminal-entry[hidden]{display:none!important}
.terminal-entry-prompt{
 flex:none;max-width:45%;overflow-wrap:anywhere;
 white-space:pre-wrap;color:#89dda1;
 font:14px/23px Consolas,Menlo,Monaco,monospace;
 user-select:text;cursor:text;
}
.terminal-entry-editor{
 display:block;flex:1;min-width:30px;width:100%;
 height:23px;max-height:140px;min-height:23px;
 margin:0;padding:0;border:none;border-radius:0;resize:none;
 overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;
 background:transparent;color:#f0f6ff;caret-color:#a7d1ff;
 font:14px/23px Consolas,Menlo,Monaco,monospace;
 tab-size:4;outline:none;box-shadow:none;
}
.terminal-entry-editor:focus,.terminal-entry-editor:focus-visible{
 outline:none;box-shadow:none;
}
.terminal-entry-editor::placeholder{color:#617a95;opacity:1}
@media(max-width:560px){
 .terminal-history{padding:8px 10px 4px;font-size:13px;line-height:21px}
 .terminal-entry{padding:7px 10px;gap:5px}
 .terminal-entry-editor,.terminal-entry-prompt{font-size:13px;line-height:21px}
}


/* General Python templates and tracing activity gallery. */
.classroom-dialog{width:min(800px,calc(100vw - 26px));max-height:88dvh;display:none;flex-direction:column;gap:10px;padding:20px;overflow:hidden}
.classroom-dialog[open]{display:flex}
.template-dialog-heading{display:flex;align-items:baseline;justify-content:space-between;gap:10px;flex-wrap:wrap}
.template-dialog-heading h3{margin:0;font-size:18px}
.template-unofficial{font-size:11px;color:#a9bad0}
.classroom-dialog>p{margin:0 0 5px;font-size:12px;line-height:1.55}
.classroom-dialog>label{font-size:12px;font-weight:650;color:#bed0e4}
.classroom-dialog #templateSearch{width:100%;padding:10px 12px;min-width:0;color:#f0f7ff;background:#121c29;border:1px solid #55708a;border-radius:6px}
.classroom-dialog #templateSearch:focus-visible{outline:2px solid #70b4ff;outline-offset:2px}
.template-gallery-caption{color:#a7b9d1;font-size:11px}
.classroom-dialog #templateGallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:10px;overflow:auto;min-height:0;padding:3px 5px 12px 0}
.classroom-dialog .template-option{display:flex;flex-direction:column;min-width:0;border:1px solid #40556b;border-radius:8px;background:#19283a;overflow:hidden}
.classroom-dialog .template-choice{display:flex;flex:1;flex-direction:column;align-items:start;gap:6px;padding:13px;background:transparent;border:0;text-align:left;color:#eaf4ff}
.classroom-dialog .template-choice:hover{background:#294059}
.classroom-dialog .template-choice strong{font-size:13px;overflow-wrap:anywhere}
.classroom-dialog .template-choice span{font-size:11px;line-height:1.4;color:#b5c7dc}
.classroom-dialog .template-choice .template-filename{color:#84c0f9;font-family:Consolas,monospace}
.template-card-actions{display:flex;justify-content:flex-end;border-top:1px solid #33485e;padding:8px 11px}
.classroom-dialog .template-link{padding:7px 10px;color:#ddecfd;background:#263a53;border:1px solid #466587;border-radius:5px;font-size:11px}
.template-dialog-footer{display:flex;justify-content:space-between;align-items:center;gap:10px;border-top:1px solid #3a4d60;padding-top:11px;color:#9cadc6;font-size:11px}
.template-dialog-footer button{border:1px solid #425775}
@media(max-width:650px){.classroom-dialog{max-height:90dvh;padding:14px}.classroom-dialog #templateGallery{grid-template-columns:1fr}.template-dialog-footer{align-items:flex-start}}

/* Context menu download appears only on files, never folders. */
.file-context-menu button[hidden]{display:none!important}
.file-context-menu button[data-action=download]{font-weight:650;color:#a7d5ff}


/* Keep the IDE usable on classroom laptops and phones. */
@media(max-width:1180px){#importProjectBtn{display:none}}
@media(max-width:980px){#startTraceBtn{display:none}#testBtn{display:none}}
@media(max-width:760px){#newBtn,#openBtn{display:none}}

.editor-area{display:flex}
.editor-area>#editor,.editor-area>#fallbackEditor{flex:1;min-width:0}
.starter-guide{flex:0 0 clamp(230px,35%,360px);min-height:0;overflow:auto;padding:14px 16px;background:#182332;border-right:1px solid #354359}
.starter-guide h2{font-size:12px;color:#a6bad2;margin:0 0 10px}
.starter-guide h3{font-size:17px;margin:10px 0 6px}
.starter-guide img{display:block;width:100%;height:auto;border-radius:6px}
.starter-guide p{font-size:13px;line-height:1.45;margin:8px 0}
@media(max-width:700px){
 .editor-area{flex-direction:column}
 .editor-area>#editor,.editor-area>#fallbackEditor{min-height:0}
 .starter-guide{flex:0 0 auto;max-height:40%;border-right:0;border-bottom:1px solid #354359}
 .starter-guide img{max-width:400px}
}

/* Organized starter template menu */
.template-filters{display:flex;align-items:center;gap:10px}
.template-filters label{font-size:12px;font-weight:650;color:#bed0e4}
.template-filters select{flex:1;min-width:0;padding:9px 12px;border:1px solid #55708a;border-radius:6px;color:#f0f7ff;background:#121c29}
.template-filters select:focus-visible{outline:2px solid #70b4ff;outline-offset:2px}
.classroom-dialog #templateGallery .template-group-heading{grid-column:1/-1;margin:9px 0 0;color:#d7e8fa;font-size:13px;border-bottom:1px solid #40556b;padding:4px 0 8px}

/* Prevent long template lists from compressing cards into clipped rows. */
.classroom-dialog #templateGallery{grid-auto-rows:max-content;align-content:start;overflow-y:auto;overflow-x:hidden;min-height:180px;flex:1 1 auto}
.classroom-dialog #templateGallery .template-option{height:auto;min-height:125px;align-self:start}
.classroom-dialog #templateGallery .template-choice{flex:0 0 auto;min-height:76px}
.classroom-dialog #templateGallery .template-group-heading{align-self:start}
