/**
 * Copyright (c) 2014 The xterm.js authors. All rights reserved.
 * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
 * https://github.com/chjj/term.js
 * @license MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * Originally forked from (with the author's permission):
 *   Fabrice Bellard's javascript vt100 for jslinux:
 *   http://bellard.org/jslinux/
 *   Copyright (c) 2011 Fabrice Bellard
 *   The original design remains. The terminal itself
 *   has been extended to include xterm CSI codes, among
 *   other features.
 */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}:root{--bg: #0e1016;--panel: #161922;--panel-2: #1c2030;--border: #272c3d;--text: #c9d1d9;--text-dim: #7d8590;--accent: #7c5cff;--accent-2: #5b9dff;--green: #3fb950;--red: #f85149;--yellow: #d29922;--mono: "SF Mono", "Consolas", "Monaco", monospace;--sans: "Segoe UI", system-ui, -apple-system, sans-serif}*{box-sizing:border-box;margin:0;padding:0}html,body,#root{height:100%}body{background:var(--bg);color:var(--text);font-family:var(--sans);font-size:13px;overflow:hidden}button{font-family:var(--sans);cursor:pointer}input,textarea{font-family:var(--sans)}.btn{border:1px solid var(--border);background:var(--panel-2);color:var(--text);border-radius:7px;padding:7px 13px;font-size:12px;display:inline-flex;align-items:center;gap:6px;transition:.12s}.btn:hover:not(:disabled){border-color:var(--accent)}.btn:disabled{opacity:.5;cursor:not-allowed}.btn-primary{background:linear-gradient(135deg,var(--accent),var(--accent-2));border:none;font-weight:600;color:#fff}.btn-green{background:var(--green);border:none;color:#06210d;font-weight:600}.btn-red{background:var(--red);border:none;color:#fff;font-weight:600}.btn-sm{padding:4px 9px;font-size:11px}.login-screen{height:100vh;display:flex;align-items:center;justify-content:center;background:radial-gradient(ellipse at top,#1a1d2e,var(--bg))}.login-card{background:var(--panel);border:1px solid var(--border);border-radius:14px;padding:36px 32px;width:340px}.login-logo{display:flex;align-items:center;gap:10px;font-size:20px;font-weight:700;margin-bottom:6px}.login-mark{width:34px;height:34px;border-radius:9px;background:linear-gradient(135deg,var(--accent),var(--accent-2));display:flex;align-items:center;justify-content:center;font-size:19px}.login-sub{color:var(--text-dim);font-size:12px;margin-bottom:22px}.field{margin-bottom:14px}.field label{display:block;font-size:11px;color:var(--text-dim);margin-bottom:5px;text-transform:uppercase;letter-spacing:.5px}.field input{width:100%;background:var(--panel-2);border:1px solid var(--border);border-radius:8px;padding:10px 12px;color:var(--text);font-size:13px;outline:none}.field input:focus{border-color:var(--accent)}.login-card .btn-primary{width:100%;justify-content:center;padding:11px}.login-error{background:#f851491f;border:1px solid rgba(248,81,73,.35);color:#ff9d96;border-radius:8px;padding:9px 11px;font-size:12px;margin-bottom:14px}.app{display:flex;flex-direction:column;height:100vh}.topbar{height:48px;background:var(--panel);border-bottom:1px solid var(--border);display:flex;align-items:center;padding:0 14px;gap:14px;flex-shrink:0}.logo{display:flex;align-items:center;gap:9px;font-weight:700;font-size:15px}.logo-mark{width:26px;height:26px;border-radius:7px;background:linear-gradient(135deg,var(--accent),var(--accent-2));display:flex;align-items:center;justify-content:center;font-size:15px}.topbar-actions{margin-left:auto;display:flex;align-items:center;gap:9px}.avatar{width:30px;height:30px;border-radius:50%;background:linear-gradient(135deg,#f0a,#a0f);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:12px;color:#fff}.dashboard{flex:1;overflow-y:auto;padding:32px}.dash-head{display:flex;align-items:center;margin-bottom:22px}.dash-head h1{font-size:20px}.dash-head .btn{margin-left:auto}.project-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px}.project-card{background:var(--panel);border:1px solid var(--border);border-radius:11px;padding:16px;cursor:pointer;transition:.12s;position:relative}.project-card:hover{border-color:var(--accent);transform:translateY(-2px)}.project-card .ptype{font-size:10px;text-transform:uppercase;letter-spacing:.6px;color:var(--accent-2);font-weight:700}.project-card h3{font-size:15px;margin:6px 0 8px}.project-card .pmeta{font-size:11px;color:var(--text-dim)}.project-card .pdelete{position:absolute;top:12px;right:12px;background:none;border:none;color:var(--text-dim);font-size:14px;opacity:0;transition:.12s}.project-card:hover .pdelete{opacity:1}.project-card .pdelete:hover{color:var(--red)}.dash-empty{color:var(--text-dim);text-align:center;padding:60px 0}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:100}.modal{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:24px;width:360px}.modal h2{font-size:16px;margin-bottom:16px}.modal-actions{display:flex;gap:9px;justify-content:flex-end;margin-top:18px}.type-picker{display:flex;gap:8px;flex-wrap:wrap}.type-opt{flex:1;min-width:70px;text-align:center;background:var(--panel-2);border:1px solid var(--border);border-radius:8px;padding:10px 6px;font-size:12px}.type-opt.sel{border-color:var(--accent);background:#7c5cff24}.main{flex:1;display:flex;min-height:0}.sidebar{width:230px;background:var(--panel);border-right:1px solid var(--border);display:flex;flex-direction:column;flex-shrink:0}.panel-head{padding:10px 13px;font-size:11px;text-transform:uppercase;letter-spacing:.8px;color:var(--text-dim);font-weight:600;display:flex;align-items:center;justify-content:space-between}.panel-head .icon-btn{background:none;border:none;color:var(--text-dim);font-size:14px}.panel-head .icon-btn:hover{color:var(--text)}.file-tree{flex:1;overflow:auto;padding:4px 0}.tree-row{padding:4px 10px;display:flex;align-items:center;gap:6px;font-size:12.5px;white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none}.tree-row:hover{background:var(--panel-2)}.tree-row.active{background:#7c5cff29;color:#fff}.center{flex:1;display:flex;flex-direction:column;min-width:0}.tabs{height:36px;background:var(--panel);border-bottom:1px solid var(--border);display:flex;flex-shrink:0;overflow-x:auto}.tab{padding:0 12px;display:flex;align-items:center;gap:7px;border-right:1px solid var(--border);font-size:12px;color:var(--text-dim);white-space:nowrap}.tab.active{background:var(--bg);color:var(--text)}.tab .close{font-size:13px;opacity:.6}.tab .close:hover{opacity:1;color:var(--red)}.tab .dirty{color:var(--accent)}.editor-wrap{flex:1;min-height:0;position:relative}.editor-empty{height:100%;display:flex;align-items:center;justify-content:center;color:var(--text-dim);flex-direction:column;gap:8px}.bottom-panel{height:200px;border-top:1px solid var(--border);display:flex;flex-direction:column;flex-shrink:0;background:#0a0c11}.bottom-tabs{height:30px;display:flex;border-bottom:1px solid var(--border)}.bottom-tab{padding:0 14px;display:flex;align-items:center;font-size:11px;text-transform:uppercase;letter-spacing:.6px;color:var(--text-dim)}.bottom-tab.active{color:var(--text);border-bottom:2px solid var(--accent)}.bottom-body{flex:1;min-height:0;overflow:hidden}.build-log{height:100%;overflow-y:auto;padding:8px 12px;font-family:var(--mono);font-size:11.5px;line-height:1.6;white-space:pre-wrap}.assistant{width:380px;background:var(--panel);border-left:1px solid var(--border);display:flex;flex-direction:column;flex-shrink:0}.chat{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:14px}.msg{display:flex;flex-direction:column;gap:5px}.msg-head{display:flex;align-items:center;gap:7px;font-size:11px;font-weight:700;color:var(--text-dim);text-transform:uppercase}.msg-icon{width:19px;height:19px;border-radius:5px;display:flex;align-items:center;justify-content:center;font-size:10px}.msg.user .msg-icon{background:linear-gradient(135deg,#f0a,#a0f)}.msg.ai .msg-icon{background:linear-gradient(135deg,var(--accent),var(--accent-2))}.msg-body{background:var(--panel-2);border:1px solid var(--border);border-radius:9px;padding:9px 11px;font-size:12.5px;line-height:1.55;white-space:pre-wrap;word-break:break-word}.msg.user .msg-body{background:#7c5cff1a;border-color:#7c5cff4d}.tool-line{font-size:11px;color:var(--text-dim);font-style:italic;padding:2px 0}.chat-input{border-top:1px solid var(--border);padding:11px}.chat-box{background:var(--panel-2);border:1px solid var(--border);border-radius:9px;padding:9px 11px}.chat-box textarea{width:100%;height:54px;resize:none;background:none;border:none;color:var(--text);font-size:12.5px;outline:none}.chat-box-foot{display:flex;align-items:center;gap:7px;margin-top:5px}.chat-box-foot .send{margin-left:auto}.preview-frame{width:100%;height:100%;border:none;background:#fff}.statusbar{height:24px;background:linear-gradient(90deg,var(--accent),var(--accent-2));display:flex;align-items:center;padding:0 12px;gap:14px;font-size:11px;color:#fff;font-weight:500;flex-shrink:0}.statusbar .sep{margin-left:auto}.spinner{width:14px;height:14px;border:2px solid rgba(255,255,255,.25);border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite;display:inline-block}@keyframes spin{to{transform:rotate(360deg)}}.center-loading{flex:1;display:flex;align-items:center;justify-content:center;color:var(--text-dim)}.toast{position:fixed;bottom:34px;left:50%;transform:translate(-50%);background:var(--panel-2);border:1px solid var(--border);padding:9px 16px;border-radius:8px;font-size:12px;z-index:200}
