:root{--bg: #eef2f7;--side: #fff;--ink: #0f172a;--muted: #64748b;--line: #e2e8f0;--accent: #2563eb;--accent-soft: #eff6ff;--warn: #b45309;--danger: #b91c1c}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{font:14px/1.45 Segoe UI,system-ui,sans-serif;color:var(--ink);background:var(--bg)}a{color:var(--accent);text-decoration:none}button,input,textarea{font:inherit}.app-shell{display:flex;flex-direction:column;height:100%;max-width:920px;margin:0 auto;background:var(--side);border-left:1px solid var(--line);border-right:1px solid var(--line)}.topbar{display:flex;align-items:center;justify-content:space-between;gap:1rem;min-height:56px;padding:.55rem 1.25rem;border-bottom:1px solid var(--line);background:#fff}.brand{font-weight:700;color:var(--ink)}.topbar-meta{display:flex;align-items:center;gap:.75rem;color:var(--muted);font-size:13px}.pill{font-size:12px;background:var(--accent-soft);color:var(--accent);border-radius:999px;padding:.15rem .6rem}.btn{border:1px solid var(--line);background:#fff;border-radius:8px;padding:.4rem .75rem;cursor:pointer;color:var(--ink)}.btn:hover{background:#f8fafc}.btn-primary{background:var(--accent);border-color:var(--accent);color:#fff}.btn-primary:hover{filter:brightness(.95);background:var(--accent)}.btn:disabled{opacity:.55;cursor:not-allowed}.login-wrap{flex:1;display:grid;place-items:center;padding:1.5rem;background:var(--bg)}.login-card{width:min(100%,380px);background:#fff;border:1px solid var(--line);border-radius:8px;padding:1.25rem 1.35rem 1.4rem}.login-card h1{margin:0 0 .35rem;font-size:1.15rem}.login-card .hint{margin:0 0 1rem;color:var(--muted);font-size:13px}.field{display:flex;flex-direction:column;gap:.3rem;margin-bottom:.85rem}.field label{font-size:11px;font-weight:650;letter-spacing:.03em;text-transform:uppercase;color:var(--muted)}.field input{border:1px solid var(--line);border-radius:8px;padding:.55rem .7rem}.field input:focus{outline:2px solid var(--accent-soft);border-color:var(--accent)}.error{color:var(--danger);font-size:13px;margin:0 0 .75rem}.chat-main{flex:1;display:flex;flex-direction:column;min-height:0}.messages{flex:1;overflow:auto;padding:1rem 1.25rem;display:flex;flex-direction:column;gap:.75rem;background:var(--bg)}.msg{max-width:85%;padding:.65rem .85rem;border-radius:8px;border:1px solid var(--line);background:#fff;white-space:pre-wrap;word-break:break-word}.msg.user{align-self:flex-end;background:var(--accent-soft);border-color:#bfdbfe}.msg.assistant{align-self:flex-start}.msg .role{display:block;font-size:11px;font-weight:650;letter-spacing:.03em;text-transform:uppercase;color:var(--muted);margin-bottom:.25rem}.composer{display:flex;gap:.6rem;padding:.85rem 1.25rem;border-top:1px solid var(--line);background:#fff}.composer textarea{flex:1;resize:none;min-height:44px;max-height:160px;border:1px solid var(--line);border-radius:8px;padding:.55rem .7rem}.composer textarea:focus{outline:2px solid var(--accent-soft);border-color:var(--accent)}.toolbar{display:flex;flex-wrap:wrap;gap:.5rem;padding:.5rem 1.25rem;border-top:1px solid var(--line);background:#fff}.empty{margin:auto;color:var(--muted);text-align:center;padding:2rem}.composer-wrap{border-top:1px solid var(--line);background:#fff;padding-top:.35rem}.attach-list{list-style:none;margin:0;padding:.35rem 1.25rem .15rem;display:flex;flex-wrap:wrap;gap:.45rem}.msg .attach-list{padding:.45rem 0 0}.attach-chip{display:inline-flex;align-items:center;gap:.4rem;border:1px solid var(--line);border-radius:8px;background:#f8fafc;padding:.25rem .45rem;max-width:100%}.attach-thumb{width:36px;height:36px;object-fit:cover;border-radius:4px}.attach-icon{font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);line-height:1}.attach-meta{display:flex;flex-direction:column;min-width:0}.attach-name{font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:160px}.attach-size{font-size:11px;color:var(--muted)}.attach-remove{border:none;background:transparent;cursor:pointer;font-size:16px;color:var(--muted);padding:0 .2rem}.attach-remove:hover{color:var(--danger)}.msg-text{white-space:pre-wrap;word-break:break-word}.server-files{margin:0 1.25rem .35rem;padding:.65rem .75rem;border:1px solid var(--line);border-radius:8px;background:#fff}.server-files-head{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.45rem}.quota-bar{height:8px;background:var(--bg);border-radius:999px;overflow:hidden;border:1px solid var(--line)}.quota-fill{height:100%;background:var(--accent);transition:width .2s ease}.quota-label{margin:.35rem 0 .5rem;font-size:12px;color:var(--muted)}.hint-inline{margin:0;font-size:12px;color:var(--muted)}.server-file-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.35rem;max-height:140px;overflow:auto}.server-file-list li{display:flex;align-items:center;gap:.5rem;font-size:13px}.server-file-list .attach-name{flex:1;max-width:none}.server-file-list .btn{padding:.2rem .5rem;font-size:12px}.row-actions{display:flex;gap:.35rem}.linkish{border:none;background:none;color:var(--accent);cursor:pointer;font:inherit;font-weight:600;text-align:left;padding:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.linkish:hover{text-decoration:underline}.progress-panel{margin:.25rem 0;padding:.75rem .85rem;border:1px dashed #93c5fd;border-radius:8px;background:#f8fbff;align-self:stretch;max-width:100%}.progress-head{display:flex;align-items:center;gap:.45rem;font-weight:650;font-size:13px;margin-bottom:.45rem;color:var(--accent)}.progress-dot{width:8px;height:8px;border-radius:50%;background:var(--accent);animation:pulse 1.1s ease-in-out infinite}@keyframes pulse{0%,to{opacity:1}50%{opacity:.35}}.progress-steps{list-style:none;margin:0;padding:0;max-height:160px;overflow:auto;display:flex;flex-direction:column;gap:.35rem}.progress-step{font-size:12px;display:grid;grid-template-columns:88px 1fr;gap:.4rem}.progress-kind{color:var(--muted);text-transform:uppercase;letter-spacing:.03em;font-size:10px;font-weight:700;padding-top:.15rem}.progress-text{color:var(--ink);white-space:pre-wrap;word-break:break-word}.progress-live{margin-top:.55rem;padding-top:.55rem;border-top:1px solid var(--line)}.md-body{font-size:14px;line-height:1.5;word-break:break-word}.md-body h1,.md-body h2,.md-body h3{margin:.6rem 0 .35rem;line-height:1.25}.md-body p{margin:.35rem 0}.md-body ul,.md-body ol{margin:.35rem 0;padding-left:1.25rem}.md-body code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.92em;background:#f1f5f9;padding:.05rem .3rem;border-radius:4px}.md-body pre{background:#0f172a;color:#e2e8f0;padding:.65rem .75rem;border-radius:8px;overflow:auto}.md-body pre code{background:transparent;color:inherit;padding:0}.md-body blockquote{margin:.45rem 0;padding-left:.75rem;border-left:3px solid var(--line);color:var(--muted)}.msg-docs{list-style:none;margin:.5rem 0 0;padding:0;display:flex;flex-direction:column;gap:.35rem}.msg-docs li{display:flex;align-items:center;gap:.5rem}.doc-editor{margin:0 1.25rem .5rem;border:1px solid var(--line);border-radius:8px;background:#fff;padding:.65rem .75rem}.doc-editor-head{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:.5rem;align-items:center}.doc-name{flex:1;min-width:140px;border:1px solid var(--line);border-radius:8px;padding:.4rem .55rem}.doc-textarea{width:100%;min-height:220px;border:1px solid var(--line);border-radius:8px;padding:.65rem;font:13px/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;resize:vertical}.doc-preview{border:1px solid var(--line);border-radius:8px;padding:.75rem;max-height:360px;overflow:auto;background:#f8fafc}.ide-shell{height:100%;display:flex;flex-direction:column;background:var(--bg)}.ide-topbar{display:flex;align-items:center;gap:.75rem;min-height:48px;padding:0 .85rem;background:#fff;border-bottom:1px solid var(--line)}.ide-top-actions{margin-left:auto}.ide-error{margin:0;padding:.4rem .85rem;background:#fef2f2}.ide-grid{flex:1;min-height:0;display:grid;grid-template-columns:minmax(200px,240px) minmax(280px,1fr) minmax(280px,360px);gap:0}.ide-sidebar{background:#fff;border-right:1px solid var(--line);overflow:auto;display:flex;flex-direction:column;gap:.75rem;padding:.65rem}.side-section{display:flex;flex-direction:column;gap:.35rem}.side-head{display:flex;align-items:center;gap:.35rem}.side-label{font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);flex:1}.new-file-row{display:flex;gap:.3rem}.new-file-row input{flex:1;min-width:0;border:1px solid var(--line);border-radius:6px;padding:.3rem .45rem;font-size:12px}.file-tree{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}.file-tree li{display:flex;align-items:center;gap:.15rem;border-radius:6px}.file-tree li.active{background:var(--accent-soft)}.tree-item{flex:1;min-width:0;display:flex;align-items:center;gap:.35rem;border:none;background:transparent;cursor:pointer;text-align:left;padding:.3rem .35rem;font:inherit;color:var(--ink)}.tree-item.static{cursor:default}.tree-icon{font-size:9px;font-weight:700;color:var(--muted);width:26px;flex-shrink:0}.tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}.tree-del{border:none;background:transparent;color:var(--muted);cursor:pointer;padding:.2rem .35rem}.tree-del:hover{color:var(--danger)}.tree-empty{color:var(--muted);font-size:12px;padding:.25rem .35rem}.quota-bar.compact{height:6px}.ide-editor{min-width:0;min-height:0;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column}.editor-pane{flex:1;min-height:0;display:flex;flex-direction:column}.editor-empty{margin:auto;text-align:center;color:var(--muted);padding:2rem}.editor-toolbar{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;padding:.5rem .65rem;border-bottom:1px solid var(--line)}.editor-modes{display:flex;gap:.25rem}.editor-body{flex:1;min-height:0;display:flex}.editor-body.mode-split .cm-wrap,.editor-body.mode-split .editor-preview{width:50%}.editor-body.mode-edit .cm-wrap,.editor-body.mode-preview .editor-preview{width:100%}.cm-wrap{min-width:0;min-height:0;height:100%;overflow:auto;border-right:1px solid var(--line)}.cm-wrap .cm-editor{height:100%;font-size:13px}.editor-preview{max-height:none;height:100%;border:none;border-radius:0;overflow:auto}.ide-chat{min-width:0;min-height:0;display:flex;flex-direction:column;background:#fff}.chat-head{padding:.55rem .75rem;border-bottom:1px solid var(--line);font-weight:650;font-size:13px;display:flex;align-items:center;justify-content:space-between;gap:.5rem}.msg-head{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.25rem}.msg-head .role{margin-bottom:0}.btn-copy{padding:.15rem .45rem;font-size:11px}.prompt-panel{max-height:220px;overflow:auto;padding:.55rem .75rem;border-bottom:1px solid var(--line);background:#f8fafc}.prompt-text{margin:.35rem 0 0;white-space:pre-wrap;font:11px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--ink)}.ide-messages{flex:1;background:var(--bg)}.ide-composer,.chat-pending{border-top:1px solid var(--line)}.muted{color:var(--muted);font-size:13px}@media(max-width:960px){.ide-grid{grid-template-columns:1fr;grid-template-rows:auto minmax(240px,40vh) minmax(240px,1fr)}.ide-sidebar,.ide-editor{border-right:none;border-bottom:1px solid var(--line);max-height:40vh}}
