/* CodePath 13.0 — multi-file project editor, preserving CodePath design tokens. */
.multi-workspace .multi-stages{grid-template-columns:repeat(auto-fit,minmax(175px,1fr));grid-auto-rows:1fr}
.multi-stages .capstone-stage{grid-template-columns:24px minmax(0,1fr);grid-template-rows:1fr auto;column-gap:9px}
.universe-stages .capstone-stage{grid-template-columns:minmax(0,1fr);row-gap:8px}
.multi-stages .capstone-stage>span{align-self:start;width:24px;height:24px;border-radius:7px;font-size:.8rem;font-variant-numeric:tabular-nums}
.multi-stages .capstone-stage b{align-self:start;padding-top:2px;line-height:20px;white-space:normal;overflow-wrap:anywhere}
.multi-top-grid{display:grid;grid-template-columns:minmax(240px,.65fr) minmax(0,1.55fr);gap:16px;align-items:start}
.multi-top-grid>.panel{margin:0;min-width:0}
.multi-editor-wrap{overflow:hidden}.multi-file-header{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;background:var(--surface-2);padding:11px 17px;border-bottom:1px solid var(--line);gap:10px}
.btn:is([data-editor-expand],#workspaceFilesToggle) {
  --bs-btn-hover-color: var(--text);
  --bs-btn-hover-bg: color-mix(in srgb, var(--surface-3), var(--text) 8%);
  --bs-btn-hover-border-color: var(--line);
  --bs-btn-active-color: var(--text);
  --bs-btn-active-bg: color-mix(in srgb, var(--surface-3), var(--text) 12%);
  --bs-btn-active-border-color: var(--line);
  font-size: .8125rem;
}
.btn:is([data-editor-expand],#workspaceFilesToggle):focus-visible { outline: 2px solid currentColor; outline-offset: 2px; box-shadow: none; }
#workspaceFilesToggle[aria-expanded="true"] .workspace-files-chevron { transform: rotate(180deg); }
.multi-editor-layout{display:grid;grid-template-columns:clamp(200px,27%,280px) minmax(0,1fr);min-height:450px}
.multi-file-tree{display:flex;flex-direction:column;gap:3px;background:var(--surface-2);border-right:1px solid var(--line);padding:11px 7px;min-width:0}
.multi-file{background:transparent;border:1px solid transparent;display:flex;align-items:center;gap:7px;color:var(--soft);border-radius:8px;text-align:left;font:0.75rem/1.4 ui-monospace,SFMono-Regular,Consolas,monospace;padding:11px 7px;min-width:0;word-break:break-word}
.multi-file>span:nth-child(2){min-width:0;overflow-wrap:anywhere}.multi-file .ui-icon{width:13px;height:13px;flex-shrink:0}.multi-file-indicator.ui-icon{width:8px;height:8px;color:var(--orange);fill:currentColor}.multi-file .multi-file-indicator{margin-left:auto}
.multi-file:hover{background:var(--surface-3);color:var(--title)}.multi-file.active{border-color:#ecab77;background:#fff1e4;color:#8c4b1c;font-weight:800}
body:not(.light) .multi-file.active{background:#5c412b;color:#ffcc9e;border-color:#a66b3b}
.multi-code-pane{min-width:0;background:#142237}.multi-code-pane .panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.multi-code-pane .panel-head>span{display:flex;align-items:center;gap:8px;min-width:0;word-break:break-all}.multi-code-pane .panel-head .ui-icon{width:14px;height:14px;color:var(--orange)}
.multi-code-pane .capstone-code{width:100%;min-height:355px;max-height:900px;resize:vertical;line-height:1.75}.multi-results{margin-top:16px}
.multi-workspace > .course-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}
.multi-workspace .capstone-work-heading{margin-bottom:13px}.multi-workspace .capstone-instructions h2{font-size:23px}
.multi-code-pane .capstone-actions>span{flex:1 0 195px}
.multi-code-pane .capstone-actions{justify-content:flex-end;border-top:1px solid var(--line)}
.multi-workspace .capstone-completed{margin-top:16px}
@media(max-width:710px){.multi-editor-layout{grid-template-columns:minmax(0,1fr)}.multi-file-tree{border-right:0;border-bottom:1px solid var(--line);display:flex;flex-direction:row;overflow-x:auto;gap:6px;padding:8px;scrollbar-width:thin}.multi-file{min-width:max-content;padding:10px 12px;white-space:nowrap}.multi-code-pane .capstone-code{min-height:300px;padding:14px}.multi-workspace .capstone-actions .btn{flex:1}.multi-workspace .capstone-actions>span{width:100%;flex-basis:100%}.multi-workspace .multi-stages{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:440px){.multi-workspace .multi-stages{grid-template-columns:1fr}}

.multi-top-grid { grid-template-columns: minmax(235px,.36fr) minmax(0,1fr); }
.multi-file-sidebar { min-width: 0; background: var(--surface-2); border-inline-end: 1px solid var(--line); }
.multi-file-sidebar .multi-file-tree { border: 0; }
.multi-code-pane { display: flex; flex-direction: column; }
.multi-code-pane .code-highlight-frame { display: flex; }
.multi-code-pane textarea.capstone-code { flex: 1; min-height: 420px; max-height: none; resize: none; }
.workspace-file-instructions p { margin-bottom: 8px; color: var(--soft); }
.workspace-file-instructions ul { margin: 7px 0 0; padding-inline-start: 22px; }
.workspace-file-instructions code { overflow-wrap: anywhere; }
.workspace-file-form { display: grid; gap: 7px; padding: 10px; }
.workspace-file-form label { display: grid; gap: 4px; color: var(--soft); font-size: .82rem; }
.workspace-file-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.workspace-file-buttons .btn { flex: 1 0 auto; }
.workspace-tree-list { list-style: none; margin: 0; padding: 0; }
.workspace-tree-list .workspace-tree-list { padding-inline-start: 12px; }
.workspace-tree-folder { display: block; padding: 6px 7px; color: var(--soft); font: 600 .75rem/1.4 ui-monospace, Consolas, monospace; }
.workspace-tree-list .multi-file { width: 100%; min-width: 0; white-space: normal; }
.multi-file-sidebar .multi-file-tree { display: block; padding: 5px 10px 10px; }
.multi-file-sidebar .workspace-tree-folder { padding: 4px 0; }
.multi-file-sidebar .workspace-tree-list .workspace-tree-list { padding-inline-start: 8px; }
.multi-file-sidebar .multi-file { gap: 6px; padding-inline: 6px; }
.team-project-tree:not(:empty) { padding: 6px 10px; background: var(--surface-2); }
.workspace-editor-dialog .team-project-tree { max-height: 22dvh; overflow: auto; }
.workspace-editor-empty { display: grid; place-content: center; flex: 1; min-height: 240px; padding: 22px; text-align: center; color: #e1edfa; background: #142237; }
.panel .workspace-editor-empty h3 { color: #e1edfa; font-size: 1.05rem; font-weight: 750; }
.panel .workspace-editor-empty p { margin: 0; color: #bacce3; }
.workspace-editor-empty code { color: #ffc08d; }
.workspace-file-error { margin: 0; color: var(--danger); font-size: .8rem; overflow-wrap: anywhere; }

.workspace-editor-dialog {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  --editor-gutter: clamp(8px, 1.5vw, 20px);
  padding: max(var(--editor-gutter), env(safe-area-inset-top))
    max(var(--editor-gutter), env(safe-area-inset-right))
    max(var(--editor-gutter), env(safe-area-inset-bottom))
    max(var(--editor-gutter), env(safe-area-inset-left));
  border: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}
html:has(.workspace-editor-dialog[open]) { overflow: hidden; }
.workspace-editor-dialog[open] { display: flex; flex-direction: column; gap: 8px; }
.workspace-editor-dialog > :is(.multi-editor-wrap,.team-editor) { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; margin: 0; overflow: hidden; }
.workspace-editor-dialog .multi-editor-layout { flex: 1; grid-template-columns: clamp(220px, 24%, 300px) minmax(0, 1fr); min-width: 0; min-height: 0; }
.workspace-editor-dialog .multi-file-sidebar { overflow: auto; }
.workspace-editor-dialog .multi-code-pane { min-height: 0; }
.workspace-editor-dialog .code-highlight-frame { flex: 1; min-height: 0; overflow: hidden; }
.workspace-editor-dialog :is(.multi-file-header,.panel-head,.capstone-actions) { flex-shrink: 0; }
.workspace-editor-dialog .team-file-tabs { max-height: 22dvh; overflow: auto; }
.workspace-editor-dialog .capstone-code { font-size: .95rem; }
.workspace-editor-dialog textarea.capstone-code { height: 100%; min-height: 0; max-height: none; resize: none; }
.workspace-editor-dialog > :is(.multi-results,#teamResult) { flex-shrink: 0; max-height: 27dvh; margin: 0; overflow: auto; }
.workspace-editor-dialog .capstone-empty-output { padding: 10px 16px; }
.workspace-editor-dialog .capstone-output { min-height: 0; }

@media(max-width:1150px) {
  .multi-top-grid { grid-template-columns: minmax(0,1fr); }
}
.multi-editor-layout:has(> .multi-file-sidebar[hidden]) { grid-template: minmax(0,1fr) / minmax(0,1fr); }
@media(max-width:710px) {
  .multi-editor-layout { grid-template-columns: minmax(0,1fr); }
  .multi-file-sidebar { border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .multi-code-pane textarea.capstone-code { min-height: 320px; }
  .workspace-editor-dialog .multi-editor-layout { grid-template: auto minmax(0,1fr) / minmax(0,1fr); }
  .workspace-editor-dialog .multi-file-sidebar { max-height: 25dvh; }
  .workspace-editor-dialog .multi-editor-wrap .capstone-actions > span { display: none; }
  .workspace-editor-dialog .workspace-editor-empty { min-height: 0; }
}
