/**
 * 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;inset: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;inset:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{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: #0f1115;--bg-elev: #171a21;--bg-elev2: #1e222b;--border: #2a2f3a;--text: #e6e8ec;--text-dim: #9aa3b2;--accent: #4c8bf5;--accent-dim: #2f5aa8;--online: #3fb950;--offline: #6e7681;--danger: #f85149;--radius: 8px;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}*{box-sizing:border-box}html,body,#app{height:100%;margin:0}body{background:var(--bg);color:var(--text);font-size:14px}#app{display:flex;flex-direction:column}.topbar{display:flex;align-items:center;justify-content:space-between;padding:0 14px;height:48px;background:var(--bg-elev);border-bottom:1px solid var(--border);flex:0 0 auto}.brand{display:flex;align-items:center;gap:8px}.brand .logo{font-size:18px}.brand .name{font-weight:600;letter-spacing:.2px}.login-hint{color:var(--text-dim);font-size:12px}.status{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--text-dim)}.dot{width:9px;height:9px;border-radius:50%;background:var(--offline);box-shadow:0 0 0 3px #6e768126}.dot[data-state=Running]{background:var(--online);box-shadow:0 0 0 3px #3fb95026}.dot[data-state=NeedsLogin],.dot[data-state=NeedsMachineAuth]{background:#d29922;box-shadow:0 0 0 3px #d2992226}.dot[data-state=Starting]{background:var(--accent);box-shadow:0 0 0 3px #4c8bf526}.layout{flex:1 1 auto;display:flex;min-height:0}.sidebar{width:280px;flex:0 0 auto;background:var(--bg-elev);border-right:1px solid var(--border);display:flex;flex-direction:column;min-height:0}.sidebar-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;border-bottom:1px solid var(--border);font-size:12px;text-transform:uppercase;letter-spacing:.6px;color:var(--text-dim)}.filter{flex:1 1 auto;max-width:130px;background:var(--bg-elev2);border:1px solid var(--border);color:var(--text);border-radius:6px;padding:4px 8px;font-size:12px}.node-list{list-style:none;margin:0;padding:6px;overflow-y:auto;flex:1 1 auto}.sidebar-empty{padding:16px;color:var(--text-dim);font-size:13px}.node{padding:8px 10px;border-radius:var(--radius);margin-bottom:4px}.node:hover{background:var(--bg-elev2)}.node-head{display:flex;align-items:center;gap:8px}.node-name{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.node-addr{color:var(--text-dim);font-size:12px;font-family:ui-monospace,monospace}.node-os{color:var(--text-dim);font-size:11px}.node-actions{display:flex;gap:6px;margin-top:6px}.workspace{flex:1 1 auto;display:flex;flex-direction:column;min-width:0;min-height:0}.tabs{display:flex;gap:2px;background:var(--bg-elev);border-bottom:1px solid var(--border);min-height:36px;overflow-x:auto}.tab{display:flex;align-items:center;gap:8px;padding:0 10px;height:36px;border-right:1px solid var(--border);color:var(--text-dim);cursor:pointer;white-space:nowrap;font-size:13px}.tab.active{color:var(--text);background:var(--bg)}.tab .tab-close{border:none;background:none;color:inherit;cursor:pointer;font-size:14px;line-height:1;opacity:.6}.tab .tab-close:hover{opacity:1;color:var(--danger)}.panes{position:relative;flex:1 1 auto;min-height:0;background:var(--bg)}.pane{position:absolute;inset:0;display:none}.pane.active{display:block}.pane.term{padding:6px}.welcome{max-width:620px;margin:8vh auto 0;padding:0 24px;color:var(--text-dim)}.welcome h1{color:var(--text);font-size:22px}.welcome-notes{margin-top:16px;line-height:1.7}.btn{background:var(--bg-elev2);border:1px solid var(--border);color:var(--text);border-radius:6px;padding:4px 10px;font-size:12px;cursor:pointer}.btn:hover{border-color:var(--accent-dim)}.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}.btn.primary:hover{background:#5b97f6}.btn.ssh{color:#9fd3a0}.btn.rdp{color:#a7c1f5}.btn.vnc{color:#e0b0f5}.btn:disabled{opacity:.4;cursor:not-allowed}.dialog{border:1px solid var(--border);background:var(--bg-elev);color:var(--text);border-radius:var(--radius);padding:20px;width:min(420px,92vw)}.dialog::backdrop{background:#0000008c}.dialog h2{margin:0 0 14px;font-size:16px}.dialog label{display:block;margin-bottom:10px;font-size:13px;color:var(--text-dim)}.dialog input{display:block;width:100%;margin-top:4px;background:var(--bg-elev2);border:1px solid var(--border);color:var(--text);border-radius:6px;padding:7px 9px;font-size:13px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin:16px 0 0;padding:0}.pane.rdp{display:none;background:#000}.pane.rdp.active{display:flex;align-items:center;justify-content:center}.pane.rdp canvas,.pane.rdp iron-remote-desktop,.pane.rdp iron-remote-gui{max-width:100%;max-height:100%}.pane.vnc{display:none;background:#000}.pane.vnc.active{display:block}.toast{position:fixed;bottom:16px;left:50%;transform:translate(-50%);background:var(--bg-elev2);border:1px solid var(--border);padding:10px 16px;border-radius:var(--radius);font-size:13px;box-shadow:0 8px 24px #0006;z-index:50;max-width:90vw}.toast.err{border-color:var(--danger);color:#ffb4ae}
