/**
 * 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: #0b0e13;--bg-panel: #11151c;--bg-raised: #171d26;--border: #232b37;--text: #d7dde5;--text-dim: #8b95a5;--accent: #61afef;--accent-strong: #4a94d6;--green: #8ec07c;--red: #e06c75;--amber: #e5c07b;--radius: 6px;--font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;--mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace}*{box-sizing:border-box}html,body,#app{height:100%;margin:0}body{background:var(--bg);color:var(--text);font-family:var(--font);font-size:14px;line-height:1.5}code{font-family:var(--mono);font-size:.9em;color:var(--text-dim)}button{font:inherit;border:1px solid var(--border);background:var(--bg-raised);color:var(--text);padding:6px 12px;border-radius:var(--radius);cursor:pointer}button:hover:not(:disabled){border-color:#3a4557}button:disabled{opacity:.45;cursor:not-allowed}button.primary{background:var(--accent-strong);border-color:var(--accent-strong);color:#06121f;font-weight:600}button.primary:hover:not(:disabled){background:var(--accent)}button.danger{border-color:#5c2b30;color:var(--red);background:#1c1315}button.danger:hover:not(:disabled){border-color:var(--red)}button.ghost{background:transparent}button.block{width:100%}input,select{font:inherit;width:100%;padding:7px 10px;background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);color:var(--text)}input:focus,select:focus{outline:none;border-color:var(--accent)}select{width:auto}label{display:block;margin-bottom:14px;color:var(--text-dim);font-size:13px}label input,label select{margin-top:5px;color:var(--text)}label.checkbox{display:flex;align-items:center;gap:8px}label.checkbox input{width:auto;margin:0}.hint{color:var(--text-dim);font-size:12.5px;margin:8px 0}.opt{color:var(--text-dim);font-weight:400}.error{color:var(--red);font-size:13px;margin:8px 0}.warning{color:var(--amber);font-size:13px;margin:8px 0;word-break:break-word}.loading,.placeholder{display:flex;align-items:center;justify-content:center;height:100%;color:var(--text-dim)}.auth-screen{display:flex;align-items:center;justify-content:center;height:100%;padding:20px}.auth-card{width:100%;max-width:390px;background:var(--bg-panel);border:1px solid var(--border);border-radius:10px;padding:28px}.auth-card h1{margin:0 0 8px;font-size:19px}.auth-lead{color:var(--text-dim);font-size:13px;margin:0 0 20px}.auth-card button[type=submit]{width:100%;margin-top:6px;background:var(--accent-strong);border-color:var(--accent-strong);color:#06121f;font-weight:600}.panel{display:grid;grid-template-columns:240px 1fr;height:100%}.sidebar{display:flex;flex-direction:column;gap:12px;padding:14px;background:var(--bg-panel);border-right:1px solid var(--border);overflow:hidden}.sidebar-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.brand{font-weight:600;font-size:13px;letter-spacing:.02em}.sidebar-head button{padding:3px 8px;font-size:12px;color:var(--text-dim)}.project-list{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:2px}.project-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;text-align:left;border:none;background:transparent;padding:7px 10px}.project-item:hover{background:var(--bg-raised)}.project-item.active{background:var(--bg-raised);box-shadow:inset 2px 0 0 var(--accent)}.project-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dot{width:7px;height:7px;border-radius:50%;background:var(--green);flex:none}.empty{color:var(--text-dim);font-size:13px;padding:8px 10px}.main{display:flex;flex-direction:column;min-width:0;overflow:hidden}.main-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:14px 18px;border-bottom:1px solid var(--border)}.main-head h2{margin:0;font-size:16px}.dir{font-size:12px}.head-actions{display:flex;align-items:center;gap:8px;flex:none}.banner{padding:9px 18px;font-size:13px;cursor:pointer}.banner.error{background:#2a1418;color:var(--red);border-bottom:1px solid #5c2b30}.session-chips,.chips{display:flex;flex-wrap:wrap;gap:6px;padding:8px 18px 0}.chip{font-size:12px;padding:4px 10px}.chip.active{border-color:var(--accent);color:var(--accent)}.global-tabs{display:flex;align-items:center;gap:6px;padding:8px 18px;overflow-x:auto;background:#0d1117;border-bottom:1px solid var(--border)}.gtab{display:flex;align-items:center;gap:6px;flex:none;font-size:12px;padding:4px 10px;background:transparent}.gtab.active{border-color:var(--accent);color:var(--accent);background:var(--bg-raised)}.gtab-index{color:var(--text-dim)}.attention-summary{margin-left:auto;flex:none;font-size:12px;color:var(--amber);padding-left:12px}.dot.attention{background:var(--amber);animation:pulse 1.6s ease-in-out infinite}.dot.busy{background:var(--accent)}@keyframes pulse{0%,to{opacity:1}50%{opacity:.25}}@media(prefers-reduced-motion:reduce){.dot.attention{animation:none}}.head-title{min-width:0}.view-switch{display:flex}.view-switch button{border-radius:0;font-size:13px}.view-switch button:first-child{border-radius:var(--radius) 0 0 var(--radius)}.view-switch button:last-child{border-radius:0 var(--radius) var(--radius) 0;border-left:none}.view-switch button.active{background:var(--accent-strong);border-color:var(--accent-strong);color:#06121f;font-weight:600}.console-tabs{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding:10px 18px 0}.tab-spacer{flex:1}button.tiny,.btn-link.tiny{font-size:12px;padding:3px 8px}.chip .dot{margin-right:2px}.content-area{flex:1;min-height:0;display:flex;padding:12px 18px 18px}.console-wrap{flex:1;min-height:0;min-width:0}.console{position:relative;flex:1;min-width:0;background:#0e1116;border:1px solid var(--border);border-radius:8px;padding:8px;overflow:hidden}.console-host{height:100%;width:100%}.console-status{position:absolute;right:14px;bottom:12px;font-size:12px;padding:4px 10px;border-radius:999px;background:#141a22f0;border:1px solid var(--border);color:var(--text-dim)}.console-status-disconnected,.console-status-unauthorized,.console-status-gone{color:var(--amber);border-color:#4d3f22}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#04070bb8;display:flex;align-items:center;justify-content:center;padding:20px;z-index:50}.modal{width:100%;max-width:460px;max-height:90vh;overflow-y:auto;background:var(--bg-panel);border:1px solid var(--border);border-radius:10px;padding:22px}.modal h3{margin:0 0 18px;font-size:16px}.modal h4{margin:0 0 8px;font-size:13px}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}.import-block,.danger-zone{margin-top:22px;padding-top:18px;border-top:1px solid var(--border)}.danger-zone h4{color:var(--red)}.chips{padding:0}.files{position:relative;flex:1;min-width:0;display:flex;flex-direction:column;background:var(--bg-panel);border:1px solid var(--border);border-radius:8px;overflow:hidden}.files.drag-over{border-color:var(--accent)}.files-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:10px 14px;border-bottom:1px solid var(--border)}.breadcrumbs{display:flex;align-items:center;flex-wrap:wrap;gap:2px;min-width:0;font-size:13px}.crumb{border:none;background:transparent;padding:2px 5px;color:var(--accent)}.crumb:hover{text-decoration:underline}.sep{color:var(--text-dim)}.files-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.upload-btn{display:inline-block;margin:0;padding:6px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-raised);color:var(--text);font-size:14px;cursor:pointer}.btn-link{display:inline-block;padding:6px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-raised);color:var(--text);font-size:14px;text-decoration:none}.btn-link:hover{border-color:#3a4557}.zip-group{display:inline-flex;align-items:center;gap:6px}.zip-all{font-size:12px;color:var(--text-dim);text-decoration:none;border-bottom:1px dotted var(--text-dim)}.zip-all:hover{color:var(--accent);border-color:var(--accent)}.file-list{flex:1;overflow-y:auto;padding:4px 0}.file-row{display:grid;grid-template-columns:26px 1fr 90px 150px auto;align-items:center;gap:8px;padding:4px 14px;font-size:13px}.file-row:hover{background:var(--bg-raised)}.file-row.list-head{position:sticky;top:0;z-index:1;background:var(--bg-panel);border-bottom:1px solid var(--border);padding-top:6px;padding-bottom:6px}.file-row.list-head:hover{background:var(--bg-panel)}.col-label{color:var(--text-dim);font-size:12px;text-transform:uppercase;letter-spacing:.04em}.sel-count{text-transform:none;letter-spacing:0;color:var(--accent)}.link-btn{border:none;background:transparent;padding:0 0 0 8px;font-size:12px;color:var(--text-dim);text-decoration:underline}.link-btn:hover{color:var(--accent)}.file-row.selected{background:#16202c}.file-row.up{grid-template-columns:1fr;border:none;background:transparent;width:100%;text-align:left}.file-row input[type=checkbox]{width:auto;margin:0}.fname{display:flex;align-items:center;gap:7px;border:none;background:transparent;padding:3px 0;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}.fname:hover{color:var(--accent)}.ficon{flex:none}.tag{font-size:10px;padding:1px 5px;border-radius:3px;background:var(--bg);border:1px solid var(--border);color:var(--text-dim)}.fsize,.fdate{color:var(--text-dim);font-size:12px;white-space:nowrap}.frow-actions{display:flex;gap:5px;opacity:0}.file-row:hover .frow-actions{opacity:1}.drop-hint{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:#0d1117d9;border:2px dashed var(--accent);border-radius:8px;color:var(--accent);pointer-events:none}.editor{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--bg-panel);border:1px solid var(--border);border-radius:8px;overflow:hidden}.editor-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 14px;border-bottom:1px solid var(--border)}.editor-path{font-family:var(--mono);font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dirty{color:var(--amber)}.editor-actions{display:flex;align-items:center;gap:8px;flex:none}.editor-actions .hint{margin:0}.editor-host{flex:1;min-height:0;overflow:auto}.editor-host .cm-editor{height:100%}@media(max-width:720px){.panel{grid-template-columns:1fr;grid-template-rows:auto 1fr}.sidebar{border-right:none;border-bottom:1px solid var(--border);max-height:40vh}.content-area{padding:8px}.file-row{grid-template-columns:26px 1fr auto}.fsize,.fdate{display:none}.frow-actions{opacity:1}}.preview{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--bg-panel);border:1px solid var(--border);border-radius:8px;overflow:hidden}.preview-bar{display:flex;align-items:center;gap:10px;padding:8px 12px;border-bottom:1px solid var(--border);font-size:12px}.preview-url{font-family:var(--mono);color:var(--text-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.preview-port{display:inline-flex;align-items:center;gap:5px;font-family:var(--mono);color:var(--green);flex:none}.preview-bar .hint{margin:0;flex:none}.preview-frame{flex:1;min-height:0;width:100%;border:none;background:#fff}.preview-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:32px;text-align:center;color:var(--text-dim)}.preview-empty h3{margin:0;font-size:15px;color:var(--text)}.preview-empty p{margin:0;max-width:34rem}.dot.live{background:var(--green);margin-left:6px}.view-switch button{display:inline-flex;align-items:center}
