/**
 * 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:#0d1017;--bg2:#11151f;--bg3:#161b27;--panel:#0f131c;--line:#222a3a;--line2:#2c3548;--txt:#e6eaf2;--dim:#8a93a6;--faint:#5b6479;--accent:#7c6cff;--accent2:#9b8cff;--green:#3ecf8e;--amber:#f5b14c;--red:#ff6b6b;--blue:#5cc8ff;--mono:"SF Mono",ui-monospace,Menlo,Consolas,monospace;--sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,system-ui,sans-serif}*{box-sizing:border-box;margin:0;padding:0}html,body,#root{height:100%}body{background:var(--bg);color:var(--txt);font-family:var(--sans);font-size:13px;overflow:hidden}button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}.boot{height:100%;display:flex;align-items:center;justify-content:center;color:var(--faint);font-size:24px}.mono{font-family:var(--mono)}.muted{color:var(--faint)}.pad{padding:10px 12px}::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-thumb{background:#222a3a;border-radius:6px}.gate{position:fixed;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:radial-gradient(1200px 600px at 70% -10%,#1a1640,#0d1017 60%)}.gate-card{width:340px;background:var(--bg2);border:1px solid var(--line2);border-radius:16px;padding:30px 28px;box-shadow:0 30px 80px #0009}.gate-logo{display:flex;align-items:center;gap:10px;margin-bottom:20px}.gate-logo .glyph{width:30px;height:30px;border-radius:8px;background:linear-gradient(135deg,var(--accent),var(--blue));display:flex;align-items:center;justify-content:center;font-weight:800;color:#fff}.gate-logo b{font-size:16px}.gate-logo span{color:var(--dim);font-size:11px}.gate-card label{display:block;color:var(--dim);font-size:11px;margin:12px 0 6px;text-transform:uppercase;letter-spacing:.6px}.gate-card input{width:100%;background:var(--bg);border:1px solid var(--line2);border-radius:9px;padding:11px 12px;color:var(--txt);font-size:13px;outline:none}.gate-card input:focus{border-color:var(--accent)}.gate-card button{width:100%;margin-top:16px;background:linear-gradient(135deg,var(--accent),#6a5cff);color:#fff;padding:11px;border-radius:9px;font-weight:600}.gate-card button:disabled{opacity:.6}.gate-err{color:var(--red);font-size:12px;margin-top:10px}.gate-note{margin-top:12px;color:var(--faint);font-size:10.5px;text-align:center}.app{display:flex;flex-direction:column;height:100vh}.topbar{height:46px;background:var(--bg2);border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 12px;gap:14px;flex-shrink:0}.brand{display:flex;align-items:center;gap:9px}.brand .glyph{width:24px;height:24px;border-radius:7px;background:linear-gradient(135deg,var(--accent),var(--blue));display:flex;align-items:center;justify-content:center;font-weight:800;font-size:13px;color:#fff}.brand b{font-size:14px}.brand small{color:var(--faint);font-size:10px}.spacer{flex:1}.ghostbtn{background:var(--bg3);border:1px solid var(--line);border-radius:8px;padding:6px 11px;font-size:11.5px;color:var(--dim)}.ghostbtn:hover{color:var(--txt)}.agent-switch{position:relative}.agent-btn{display:flex;align-items:center;gap:9px;background:var(--bg3);border:1px solid var(--line2);border-radius:9px;padding:6px 11px;font-size:13px;min-width:180px}.agent-btn .dot{width:8px;height:8px;border-radius:50%}.agent-btn .caret{margin-left:auto;color:var(--dim)}.agent-menu{position:absolute;top:40px;left:0;width:250px;background:var(--bg2);border:1px solid var(--line2);border-radius:11px;padding:6px;box-shadow:0 20px 50px #0000008c;z-index:50}.agent-item{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:8px;cursor:pointer}.agent-item:hover{background:var(--bg3)}.agent-item .ico{width:22px;height:22px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:800;color:#fff}.agent-item .nm{font-size:12.5px}.agent-item small{color:var(--faint);font-size:10px;display:block}.body{flex:1;display:flex;min-height:0}.col{display:flex;flex-direction:column;min-height:0}.splitter{flex:0 0 5px;cursor:col-resize;background:var(--line);position:relative;transition:background .15s}.splitter:hover,.splitter:active{background:var(--accent)}.splitter:after{content:"";position:absolute;top:50%;left:1px;width:3px;height:26px;transform:translateY(-50%);border-radius:3px;background:var(--line2)}.splitter:hover:after{background:#fff}.colhead{height:34px;display:flex;align-items:center;gap:8px;padding:0 12px;border-bottom:1px solid var(--line);font-size:11px;text-transform:uppercase;letter-spacing:.7px;color:var(--dim);flex-shrink:0;background:var(--panel)}.colhead.nopad{padding:0 8px;text-transform:none;letter-spacing:0}.colhead .h-act{margin-left:auto;display:flex;gap:6px;align-items:center}.iconbtn{width:26px;height:26px;border-radius:7px;display:flex;align-items:center;justify-content:center;color:var(--dim);text-decoration:none}.iconbtn:hover{background:var(--bg3);color:var(--txt)}.col-files{width:250px;background:var(--panel);border-right:1px solid var(--line)}.tree{flex:1;overflow:auto;padding:6px 4px;font-size:12.5px}.trow{display:flex;align-items:center;gap:6px;padding:3px 6px;border-radius:6px;cursor:pointer;white-space:nowrap}.trow:hover{background:var(--bg3)}.trow.active{background:#7c6cff29;color:var(--accent2)}.trow.dim{opacity:.45}.trow .tw{color:var(--faint);width:10px;font-size:9px;text-align:center}.trow .nm{overflow:hidden;text-overflow:ellipsis}.col-center{flex:1;background:var(--bg);border-right:1px solid var(--line);min-width:0}.seg{display:flex;background:var(--bg3);border:1px solid var(--line2);border-radius:9px;padding:2px;margin:4px 0}.seg button{padding:5px 13px;border-radius:7px;font-size:12px;color:var(--dim);font-weight:500;display:flex;align-items:center;gap:6px}.seg button.on{background:var(--accent);color:#fff}.seg button:disabled{opacity:.45;cursor:default}.urlbar{flex:1;display:flex;align-items:center;gap:8px;background:var(--bg3);border:1px solid var(--line);border-radius:8px;padding:4px 10px;margin-left:10px;font-size:11.5px;color:var(--dim);font-family:var(--mono)}.urlbar .lock{color:var(--green)}.urlbar .u{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.center-body{flex:1;position:relative;background:#fff;min-height:0}.preview{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;border:0;background:#fff}.codeview{position:absolute;top:0;right:0;bottom:0;left:0;margin:0;overflow:auto;background:#0a0d14;color:#d7dbe6;font-family:var(--mono);font-size:12px;line-height:1.55;padding:14px;white-space:pre}.hbadge{font-size:9.5px;font-weight:700;padding:1px 6px;border-radius:20px;line-height:1.6}.hbadge.ok{background:#3ecf8e2e;color:var(--green)}.hbadge.warn{background:#f5b14c2e;color:var(--amber)}.hbadge.bad{background:#ff6b6b2e;color:var(--red)}.hbadge.unk{background:var(--line);color:var(--faint)}.col-term{width:440px;background:#0a0d14;display:flex;flex-direction:column}.rtabs{display:flex;gap:4px}.rtab{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--dim);padding:7px 13px;border-radius:8px 8px 0 0;border-bottom:2px solid transparent}.rtab.on{color:var(--txt);background:#0a0d14;border-bottom:2px solid var(--accent)}.rtab.on.ai{border-bottom-color:var(--accent2);color:var(--accent2)}.startclaude-sm{color:var(--green);border:1px solid var(--line2);border-radius:7px;padding:3px 9px;font-size:10.5px}.startclaude-sm:hover{background:var(--bg3)}.livedot{width:8px;height:8px;border-radius:50%;background:var(--faint)}.livedot.live{background:var(--green);box-shadow:0 0 8px var(--green)}.livedot.connecting{background:var(--amber)}.livedot.disconnected{background:var(--red)}.livetxt{font-size:10.5px;color:var(--faint);font-family:var(--mono)}.modebadge{font-size:10px;color:var(--faint);padding:5px 14px;border-bottom:1px solid var(--line);background:#0b0e16}.modebadge b{color:var(--accent2)}.xterm-wrap{flex:1;min-height:0;padding:6px 4px 6px 8px;overflow:hidden}.livechat{flex:1;min-height:0;overflow:auto;padding:12px 14px;display:flex;flex-direction:column;gap:10px;background:#0a0d14}.xterm-wrap .xterm{height:100%}.reconnect{padding:6px 12px;font-size:11px;color:var(--amber);background:#1a1410}.reconnect button{color:var(--accent2);text-decoration:underline}.ai-input{border-top:1px solid var(--line);padding:9px 10px;flex-shrink:0;background:#0a0d14}.ai-sent{display:flex;flex-direction:column;gap:4px;margin-bottom:7px}.ai-sent .bubble{align-self:flex-end;background:var(--accent);color:#fff;font-size:11px;padding:5px 10px;border-radius:11px 11px 3px;max-width:90%}.ai-input .box{display:flex;align-items:flex-end;gap:8px;background:var(--bg2);border:1px solid var(--line2);border-radius:12px;padding:8px 10px}.ai-input textarea{flex:1;background:none;border:none;outline:none;color:var(--txt);font-family:var(--sans);font-size:12.5px;resize:none;height:34px;line-height:1.4}.ai-input .send{width:30px;height:30px;border-radius:9px;background:var(--accent2);color:#fff;display:flex;align-items:center;justify-content:center;flex-shrink:0}.ai-input .foot{display:flex;align-items:center;gap:10px;margin-top:7px;font-size:10px;color:var(--faint)}.ai-input .startclaude{color:var(--green);border:1px solid var(--line2);border-radius:7px;padding:3px 9px;font-size:10.5px}.ai-input .startclaude:hover{background:var(--bg3)}.hist{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;background:#0b0e16}.hist-bar{display:flex;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid var(--line);flex-shrink:0}.hist-sel{flex:1;min-width:0;background:var(--bg3);border:1px solid var(--line2);border-radius:8px;color:var(--txt);font-size:12px;padding:6px 9px;font-family:var(--sans)}.hist-search{width:200px;background:var(--bg3);border:1px solid var(--line2);border-radius:8px;color:var(--txt);font-size:12px;padding:6px 9px;outline:none}.hist-search:focus{border-color:var(--accent)}.hist-count{font-size:10.5px;color:var(--faint);white-space:nowrap}.hist-body{flex:1;overflow:auto;padding:14px 16px;display:flex;flex-direction:column;gap:10px}.hb{font-size:12.5px;line-height:1.6;max-width:860px}.hb-tag{font-size:10px;text-transform:uppercase;letter-spacing:.6px;color:var(--faint);margin-bottom:3px}.hb-tag.clk{cursor:pointer;-webkit-user-select:none;user-select:none}.hb-text{white-space:pre-wrap;word-break:break-word}.hb.user{align-self:flex-end;background:var(--accent);color:#fff;padding:9px 13px;border-radius:13px 13px 4px;max-width:80%}.hb.user .hb-tag{color:#ffffffb3}.hb.asst .hb-tag{color:var(--accent2)}.hb.asst .hb-text{color:var(--txt)}.hb.think .hb-text{color:var(--faint);font-style:italic}.hb.tool,.hb.result{border-left:2px solid var(--line2);padding-left:11px}.hb.tool .hb-tag{color:var(--blue);text-transform:none;letter-spacing:0;font-family:var(--mono);font-size:11.5px}.hb-cmd{color:var(--dim)}.hb-pre{margin:5px 0 0;font-family:var(--mono);font-size:11px;line-height:1.55;color:var(--dim);white-space:pre-wrap;word-break:break-word;background:var(--bg);border:1px solid var(--line);border-radius:7px;padding:7px 10px;overflow:auto;max-height:340px}.hb-pre.cmd{color:var(--green)}.hb-pre .del{color:var(--red)}.hb-pre .add{color:var(--green)}.hb-pre.dim,.dim{color:var(--faint)}.statusbar{height:24px;background:var(--accent);color:#fff;display:flex;align-items:center;gap:16px;padding:0 12px;font-size:11px;flex-shrink:0}.statusbar .spacer{flex:1}
