/**
 * 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: #0d0d0f;--surface: #1a1a1e;--surface-2: #232329;--border: #2c2c34;--text: #f2f2f5;--text-dim: #9a9aa5;--accent: #ff7a1a;--accent-dim:#c95e12;--green: #22c55e;--red: #ef4444;--blue: #3b82f6;--purple: #8b5cf6;--radius: 18px;--radius-sm: 12px}*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}html,body,#root{height:100%;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;font-size:15px;-webkit-font-smoothing:antialiased}button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}input{font-family:inherit}a{color:var(--accent);text-decoration:none}.app{max-width:640px;margin:0 auto;min-height:100%;display:flex;flex-direction:column}.topbar{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;position:sticky;top:0;z-index:20;background:linear-gradient(180deg,var(--bg) 70%,transparent);backdrop-filter:blur(8px)}.topbar .title{font-weight:700;font-size:17px;letter-spacing:.2px}.topbar .brand-accent{color:var(--accent)}.pill-btn{background:var(--surface);border-radius:999px;padding:9px 16px;color:var(--text);font-weight:600;font-size:14px;display:inline-flex;align-items:center;gap:7px;border:1px solid var(--border)}.pill-btn:active{background:var(--surface-2)}.icon-btn{width:42px;height:42px;border-radius:999px;background:var(--surface);display:grid;place-items:center;border:1px solid var(--border)}.content{padding:4px 16px 90px;flex:1}.section-title{font-size:20px;font-weight:700;margin:22px 2px 12px}.muted{color:var(--text-dim)}.card{background:var(--surface);border-radius:var(--radius);border:1px solid var(--border);padding:18px;margin-bottom:14px}.stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.stat{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px}.stat .label{display:flex;align-items:center;gap:8px;color:var(--text-dim);font-size:13px;font-weight:600}.stat .value{font-size:30px;font-weight:800;margin-top:8px;letter-spacing:-.5px}.stat .sub{color:var(--text-dim);font-size:12px;margin-top:4px}.stat .icon{color:var(--accent)}.vm-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px;margin-bottom:12px}.vm-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.vm-name{font-weight:700;font-size:16px;display:flex;align-items:center;gap:9px}.vm-name .dot{width:10px;height:10px;border-radius:999px;flex:none}.dot.running{background:var(--green);box-shadow:0 0 8px var(--green)}.dot.stopped{background:var(--red)}.vm-id{color:var(--text-dim);font-size:13px;margin-top:3px}.vm-status{text-align:right;font-size:13px}.vm-status .st{font-weight:700}.vm-status .cpu{color:var(--text-dim);margin-top:3px}.badge{display:inline-block;padding:2px 9px;border-radius:7px;font-size:11px;font-weight:700;background:var(--surface-2);color:var(--text-dim);margin-left:8px;vertical-align:middle}.vm-actions{display:flex;gap:9px;margin-top:14px;flex-wrap:wrap}.btn{flex:1;min-width:90px;padding:11px 12px;border-radius:var(--radius-sm);background:var(--surface-2);font-weight:600;font-size:14px;display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid var(--border)}.btn:active{transform:scale(.98)}.btn.primary{background:var(--accent);color:#14100b;border-color:transparent}.btn.primary:active{background:var(--accent-dim)}.btn.ghost{background:transparent}.btn.danger{color:var(--red)}.btn:disabled{opacity:.45;pointer-events:none}.tabs{display:flex;gap:8px;background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:5px;margin:6px 0 16px}.tabs button{flex:1;padding:9px;border-radius:999px;color:var(--text-dim);font-weight:700;font-size:13px}.tabs button.active{background:var(--accent);color:#14100b}.progress{height:8px;border-radius:999px;background:var(--surface-2);overflow:hidden;margin-top:8px}.progress>span{display:block;height:100%;background:var(--accent);border-radius:999px}.progress.blue>span{background:var(--blue)}.metric-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}.metric-row .k{color:var(--text-dim);font-size:13px}.metric-row .v{font-weight:700}.console-wrap{position:fixed;inset:0;background:#000;z-index:50;display:flex;flex-direction:column}.console-bar{display:flex;align-items:center;gap:8px;padding:10px 12px;background:var(--surface);border-bottom:1px solid var(--border);flex-wrap:wrap}.console-bar .spacer{flex:1}.console-screen{flex:1;overflow:hidden;display:grid;place-items:center;background:#000}.console-screen canvas{max-width:100%;max-height:100%}.chip-btn{padding:8px 12px;border-radius:10px;background:var(--surface-2);font-size:13px;font-weight:600;border:1px solid var(--border);display:inline-flex;align-items:center;gap:6px}.chip-btn.accent{background:var(--accent);color:#14100b;border-color:transparent}.login-wrap{min-height:100%;display:grid;place-items:center;padding:24px}.login-card{width:100%;max-width:380px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:28px 24px}.login-card h1{font-size:24px;margin-bottom:4px}.login-card .sub{color:var(--text-dim);margin-bottom:22px;font-size:14px}.field{margin-bottom:14px}.field label{display:block;font-size:13px;color:var(--text-dim);margin-bottom:6px;font-weight:600}.field input{width:100%;padding:13px 14px;border-radius:var(--radius-sm);background:var(--bg);border:1px solid var(--border);color:var(--text);font-size:15px}.field input:focus{outline:none;border-color:var(--accent)}.error-msg{color:var(--red);font-size:13px;margin:6px 0 12px}.admin-user{border:1px solid var(--border);border-radius:var(--radius-sm);padding:14px;margin-bottom:12px;background:var(--surface)}.admin-user .u-head{display:flex;justify-content:space-between;align-items:center}.tag-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.tag{background:var(--surface-2);border:1px solid var(--border);border-radius:8px;padding:4px 8px;font-size:12px;display:inline-flex;align-items:center;gap:6px}.tag button{color:var(--red);font-weight:800}.assign-row{display:flex;gap:8px;margin-top:10px}.assign-row select{flex:1;padding:9px;border-radius:10px;background:var(--bg);border:1px solid var(--border);color:var(--text)}.bottom-nav{position:fixed;bottom:0;left:0;right:0;max-width:640px;margin:0 auto;display:flex;background:var(--surface);border-top:1px solid var(--border);padding:8px 0 calc(8px + env(safe-area-inset-bottom))}.bottom-nav button{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;color:var(--text-dim);font-size:11px;font-weight:600;padding:4px}.bottom-nav button.active{color:var(--accent)}.spinner{width:28px;height:28px;border:3px solid var(--border);border-top-color:var(--accent);border-radius:999px;animation:spin .8s linear infinite;margin:40px auto}@keyframes spin{to{transform:rotate(360deg)}}.center-msg{text-align:center;color:var(--text-dim);padding:50px 20px}@media (prefers-reduced-motion: reduce){*{animation:none!important;transition:none!important}}
