:root {
  color-scheme: dark;
  --bg: #0c0e0d;
  --surface: #121413;
  --surface-2: #171a18;
  --surface-3: #1f2220;
  --line: #2b2f2c;
  --line-strong: #3a403c;
  --text: #eef1ef;
  --muted: #8e9691;
  --green: #7be2a8;
  --red: #f34a4f;
  --yellow: #e6bd61;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
:root[data-theme="light"] { color-scheme: light; --bg:#f4f5f4; --surface:#fff; --surface-2:#f0f2f0; --surface-3:#e8ebe9; --line:#d5d9d6; --line-strong:#bec5c0; --text:#191c1a; --muted:#69716c; --green:#17864b; --red:#d83d42; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body { margin: 0; color: var(--text); background: var(--bg); }
button, textarea, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.workspace { height: 100dvh; display: grid; grid-template-rows: 54px 1fr; }
.titleBar { display: grid; grid-template-columns: 230px 1fr auto; align-items: center; border-bottom: 1px solid var(--line); background: var(--surface); }
.workspaceBrand { height: 100%; display: flex; align-items: center; gap: 9px; padding-left: 13px; border-right: 1px solid var(--line); color: inherit; text-decoration: none; }
.workspaceBrand > span { position: relative; display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; color: #fff; background: var(--red); font-weight: 900; }.workspaceBrand i { position:absolute; right:3px; bottom:1px; color:var(--green); font:900 7px ui-monospace,monospace; }
.workspaceBrand strong { font-size: 14px; }
.workspaceIdentity { min-width: 0; display: grid; justify-items: center; line-height: 1.2; }.workspaceIdentity strong { max-width: 55vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }.workspaceIdentity small { color: var(--muted); font-size: 10px; }
.titleActions { display: flex; align-items: center; gap: 7px; padding-right: 10px; }.titleActions button, .titleActions a { min-height: 34px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); background: var(--surface-2); text-decoration:none; font-size:12px; }.titleActions #themeBtn { width: 34px; padding: 0; }
.workspaceMain { min-height: 0; display: grid; grid-template-columns: 230px minmax(360px, 1fr) 370px; }

.fileSidebar, .agentPane { min-height: 0; background: var(--surface); }
.fileSidebar { display: grid; grid-template-rows: 43px 43px 1fr 30px; border-right: 1px solid var(--line); }
.fileSidebar > header { display:flex; align-items:center; justify-content:space-between; padding:0 12px; color:var(--muted); text-transform:uppercase; letter-spacing:.12em; font-size:10px; }.fileSidebar > header button { border:0; color:var(--muted); background:none; font-size:17px; }
.fileSearch { margin: 5px 9px; display:flex; align-items:center; gap:7px; padding:0 9px; border:1px solid var(--line); border-radius:7px; color:var(--muted); background:var(--bg); }.fileSearch input { width:100%; min-width:0; border:0; outline:0; color:var(--text); background:transparent; font-size:11px; }
.emptyFiles { align-self:start; margin:35px 16px; text-align:center; }.emptyFiles > span { display:block; color:var(--green); font-size:34px; }.emptyFiles strong { display:block; margin:12px 0 5px; font-size:13px; }.emptyFiles p { margin:0 0 14px; color:var(--muted); font-size:11px; line-height:1.5; }.emptyFiles button { padding:8px 11px; border:1px solid var(--line-strong); border-radius:7px; background:var(--surface-2); font-size:11px; }
.fileTree { min-height:0; overflow:auto; padding:6px 0 16px; }
.fileTree button { width:100%; min-height:27px; display:flex; align-items:center; gap:7px; padding:2px 9px; border:0; color:var(--muted); background:transparent; text-align:left; font:11px ui-monospace,SFMono-Regular,Menlo,monospace; }.fileTree button:hover { color:var(--text); background:var(--surface-3); }.fileTree button.active { color:var(--text); background:color-mix(in srgb,var(--green) 13%,transparent); }.fileTree button span:first-child { color:#78807b; }.fileTree button span:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fileTreeEmpty { margin:24px 12px; color:var(--muted); text-align:center; font-size:10px; }
.fileSidebar > footer { display:flex; align-items:center; justify-content:space-between; padding:0 10px; border-top:1px solid var(--line); color:var(--muted); font-size:9px; }

.editorPane { min-width:0; min-height:0; display:grid; grid-template-rows:43px 1fr 27px; background:var(--bg); }
.editorTabs { min-width:0; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line); background:var(--surface); }
.activeTab { height:100%; min-width:140px; display:flex; align-items:center; gap:7px; padding:0 12px; border-right:1px solid var(--line); background:var(--bg); font-size:11px; }.activeTab #fileDot { color:var(--muted); font-size:7px; }.activeTab.dirty #fileDot { color:var(--yellow); }.activeTab button { margin-left:auto; border:0; color:var(--muted); background:none; }
.editorActions { display:flex; gap:7px; padding-right:8px; }.editorActions button { min-height:29px; padding:0 9px; border:1px solid var(--line); border-radius:6px; color:var(--muted); background:var(--surface-2); font-size:10px; }.editorActions button:not(:disabled):hover { color:var(--text); border-color:var(--line-strong); }.editorActions button:disabled { opacity:.45; }.editorActions kbd { margin-left:6px; color:var(--muted); font-size:8px; }
.editorWelcome { min-height:0; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:40px; text-align:center; }.welcomeMark { position:relative; display:grid; place-items:center; width:72px; height:72px; border-radius:20px; color:white; background:var(--red); font-size:31px; font-weight:900; box-shadow:0 22px 60px #f34a4f30; }.welcomeMark i { position:absolute; right:8px; bottom:4px; color:var(--green); font:900 13px ui-monospace,monospace; }.editorWelcome h1 { margin:25px 0 11px; font-size:clamp(34px,4vw,57px); letter-spacing:-.06em; line-height:.98; }.editorWelcome > p { max-width:620px; margin:0; color:var(--muted); line-height:1.6; }.welcomeActions { display:flex; gap:9px; margin-top:25px; }.welcomeActions button { padding:11px 14px; border:1px solid var(--line-strong); border-radius:8px; background:var(--surface-2); }.welcomeActions button:first-child { border-color:transparent; color:#07120b; background:var(--green); font-weight:800; }.editorWelcome dl { display:flex; gap:24px; margin-top:45px; color:var(--muted); font-size:10px; }.editorWelcome dl div { display:flex; gap:7px; }.editorWelcome dt { padding:2px 5px; border:1px solid var(--line); border-radius:4px; }.editorWelcome dd { margin:2px 0; }
.editorSurface { min-height:0; display:grid; grid-template-columns:55px 1fr; overflow:hidden; }.lineNumbers { min-height:0; overflow:hidden; padding:15px 9px 40px 0; color:#555d58; border-right:1px solid var(--line); text-align:right; white-space:pre; font:12px/1.65 ui-monospace,SFMono-Regular,Menlo,monospace; user-select:none; }.editorSurface textarea { width:100%; height:100%; resize:none; overflow:auto; padding:15px 20px 80px; border:0; outline:0; color:var(--text); background:transparent; tab-size:2; white-space:pre; font:13px/1.65 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; }
.editorStatus { display:flex; align-items:center; gap:18px; justify-content:flex-end; padding:0 10px; border-top:1px solid var(--line); color:var(--muted); background:var(--surface); font-size:9px; }

.agentPane { min-width:0; display:grid; grid-template-rows:52px auto auto 1fr auto; border-left:1px solid var(--line); }
.agentPane > header { display:flex; align-items:center; justify-content:space-between; padding:0 12px; border-bottom:1px solid var(--line); }.agentPane > header > div { display:grid; }.agentPane > header strong { font-size:13px; }.agentPane > header small { color:var(--muted); font-size:9px; }.agentPane > header button { border:0; color:var(--muted); background:none; font-size:10px; }
.agentContext { margin:10px; padding:10px; display:grid; gap:3px; border:1px solid var(--line); border-radius:8px; background:var(--surface-2); }.agentContext > span { color:var(--green); text-transform:uppercase; letter-spacing:.13em; font:700 8px ui-monospace,monospace; }.agentContext strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }.agentContext small { color:var(--muted); font-size:9px; }
.missionControls { display:grid; gap:9px; margin:0 10px 6px; padding:9px 10px; border:1px solid var(--line); border-radius:8px; background:var(--bg); }
.missionControls label { display:flex; align-items:center; justify-content:space-between; color:var(--muted); text-transform:uppercase; letter-spacing:.1em; font:700 8px ui-monospace,monospace; }
.missionControls select { min-width:105px; height:25px; padding:0 7px; border:1px solid var(--line); border-radius:6px; color:var(--text); background:var(--surface-2); text-transform:none; letter-spacing:0; font:10px ui-sans-serif,sans-serif; }
.proofRail { display:grid; grid-template-columns:auto 1fr auto 1fr auto; align-items:center; gap:5px; }
.proofRail > i { height:1px; background:var(--line); }
.proofRail > span { display:flex; align-items:center; gap:4px; color:var(--muted); font:8px ui-monospace,monospace; }
.proofRail b { display:grid; width:15px; height:15px; place-items:center; border:1px solid var(--line); border-radius:50%; font-size:7px; }
.proofRail span[data-state="active"] { color:var(--green); }
.proofRail span[data-state="active"] b { border-color:var(--green); box-shadow:0 0 0 3px color-mix(in srgb,var(--green) 10%,transparent); }
.proofRail span[data-state="complete"] { color:var(--text); }
.proofRail span[data-state="complete"] b { border-color:var(--green); color:#06130c; background:var(--green); }
.agentMessages { min-height:0; overflow:auto; padding:5px 11px 20px; }.agentMessage { display:grid; grid-template-columns:24px 1fr; gap:8px; margin:15px 0; }.agentMessage > span { display:grid; place-items:center; width:24px; height:24px; border-radius:7px; color:#07120b; background:var(--green); font-size:10px; font-weight:900; }.agentMessage.user > span { color:white; background:var(--red); }.agentMessage > div { min-width:0; }.agentMessage strong { font-size:10px; }.agentMessage p { margin:5px 0; color:#b3b9b5; white-space:pre-wrap; overflow-wrap:anywhere; font:11px/1.6 ui-sans-serif,sans-serif; }.agentMessage pre { max-width:100%; overflow:auto; padding:9px; border:1px solid var(--line); border-radius:7px; color:#cbd1cd; background:var(--bg); font:10px/1.5 ui-monospace,monospace; }.agentMessage .proposalNotice { margin-top:8px; padding:8px; border:1px solid color-mix(in srgb,var(--green) 30%,var(--line)); border-radius:7px; color:var(--green); font-size:9px; }
.agentComposer { margin:9px; padding:8px; border:1px solid var(--line-strong); border-radius:10px; background:var(--surface-2); }.agentComposer textarea { width:100%; resize:none; border:0; outline:0; color:var(--text); background:transparent; font-size:11px; line-height:1.45; }.agentComposer > div { display:flex; align-items:center; gap:6px; }.agentComposer select { min-width:0; flex:1; height:28px; border:0; color:var(--muted); background:transparent; font-size:9px; }.agentComposer button { width:28px; height:28px; border:0; border-radius:7px; color:#07120b; background:var(--green); font-weight:900; }.agentComposer #stopAgentBtn { width:auto; padding:0 9px; color:var(--text); background:var(--surface-3); }.agentComposer > small { display:block; margin-top:5px; color:#666e69; font-size:8px; }

dialog { width:min(1100px,calc(100% - 30px)); height:min(820px,calc(100% - 30px)); padding:0; border:1px solid var(--line-strong); border-radius:15px; color:var(--text); background:var(--surface); box-shadow:0 40px 140px #000; } dialog::backdrop { background:#000b; backdrop-filter:blur(6px); }.diffPanel { height:100%; display:grid; grid-template-rows:auto auto 1fr auto; }.diffPanel > header { display:flex; justify-content:space-between; padding:19px 22px; border-bottom:1px solid var(--line); }.diffPanel header p { margin:0 0 4px; color:var(--green); text-transform:uppercase; letter-spacing:.13em; font:800 8px ui-monospace,monospace; }.diffPanel h2 { margin:0; font-size:20px; }.diffPanel header small { color:var(--muted); }.diffPanel header button { width:34px; height:34px; border:1px solid var(--line); border-radius:50%; background:transparent; }.diffLegend { min-height:40px; display:flex; align-items:center; gap:20px; padding:0 20px; border-bottom:1px solid var(--line); color:var(--muted); font-size:9px; }.diffLegend span { display:flex; align-items:center; gap:5px; }.diffLegend i { width:8px; height:8px; border-radius:2px; }.diffLegend .removed { background:#f34a4f99; }.diffLegend .added { background:#7be2a899; }.diffLegend small { margin-left:auto; }.diffContent { min-height:0; overflow:auto; padding:14px 0; font:11px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace; }.diffRow { display:grid; grid-template-columns:46px 1fr 46px 1fr; min-height:24px; }.diffRow span { padding:3px 8px; white-space:pre-wrap; overflow-wrap:anywhere; }.diffRow .lineNo { color:#5d655f; text-align:right; user-select:none; }.diffRow.changed .oldCode { color:#ffadb0; background:#f34a4f12; }.diffRow.changed .newCode { color:#9df0bf; background:#7be2a812; }.diffPanel > footer { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; padding:13px 18px; border-top:1px solid var(--line); }.diffPanel > footer button { padding:10px 13px; border:1px solid var(--line-strong); border-radius:8px; background:var(--surface-2); }.diffPanel #challengeChangeBtn { border-color:color-mix(in srgb,var(--green) 40%,var(--line)); color:var(--green); }.diffPanel #applyChangeBtn { border-color:transparent; color:#07120b; background:var(--green); font-weight:800; }
.workspaceToast { position:fixed; left:50%; bottom:24px; z-index:20; transform:translateX(-50%); max-width:min(520px,calc(100% - 28px)); padding:11px 15px; border:1px solid var(--line-strong); border-radius:9px; color:var(--text); background:var(--surface-3); box-shadow:0 18px 60px #0008; font-size:11px; }
.workspaceToast[data-type="error"] { border-color:color-mix(in srgb,var(--red) 55%,var(--line)); color:#ffb6b8; }
.agentMessage.error p { color:#ff9da0; }

@media (max-width:1000px) { .workspaceMain { grid-template-columns:190px minmax(320px,1fr) 310px; }.titleBar { grid-template-columns:190px 1fr auto; } }
@media (max-width:760px) { html,body { overflow:auto; }.workspace { height:auto; min-height:100dvh; grid-template-rows:auto 1fr; }.titleBar { min-height:54px; grid-template-columns:auto 1fr; }.workspaceIdentity { display:none; }.workspaceBrand { border-right:0; }.titleActions a,#themeBtn { display:none; }.workspaceMain { display:flex; flex-direction:column; }.fileSidebar { min-height:280px; border-right:0; border-bottom:1px solid var(--line); }.editorPane { min-height:620px; }.agentPane { min-height:650px; border-left:0; border-top:1px solid var(--line); }.diffRow { grid-template-columns:35px 1fr; }.diffRow .newNo,.diffRow .newCode { display:none; }.diffLegend span:nth-child(2) { display:none; } }
@media (prefers-reduced-motion:reduce) { * { scroll-behavior:auto!important; transition:none!important; } }
