/**
 * 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{color-scheme:dark}*{box-sizing:border-box}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;background:radial-gradient(circle at top left,#2c2f72,#15172f 45%,#0a0b12);color:#eaf1ff}a{color:#a4cbff}.muted{color:#9aa8cf;font-size:.92rem}.tiny{font-size:.75rem}.error{color:#ff7f91;margin:0}.error.small{font-size:.85rem}.error.inline{margin-left:auto}.btn{border:0;border-radius:12px;padding:.62rem .95rem;font-weight:600;font-size:.92rem;cursor:pointer;transition:transform .2s ease,opacity .2s ease,box-shadow .2s ease}.btn:hover{transform:translateY(-1px)}.btn:disabled{cursor:not-allowed;opacity:.55;transform:none}.btn-primary{color:#fff;background:linear-gradient(135deg,#6575ff,#7b57ff 55%,#b05cff);box-shadow:0 12px 22px #7e60ff4d}.btn-secondary{background:#8e9cd333;color:#d8e2ff}.btn-ghost{background:transparent;color:#b9c7f6;border:1px solid rgba(160,175,225,.36)}.brand-pill{display:inline-flex;align-items:center;gap:.4rem;border-radius:999px;padding:.35rem .7rem;border:1px solid rgba(156,177,255,.35);background:#49599133;color:#dce6ff;font-size:.78rem;letter-spacing:.05em;text-transform:uppercase}.gate-page,.auth-page{position:relative;min-height:100vh;display:flex;align-items:center;justify-content:center;padding:1.2rem;overflow:hidden}.bg-glow{position:absolute;width:40rem;height:40rem;border-radius:50%;filter:blur(48px);opacity:.24;pointer-events:none}.bg-glow-a{background:#6f78ff;top:-16rem;left:-10rem}.bg-glow-b{background:#ba63ff;right:-12rem;bottom:-18rem}.gate-card,.card{width:min(500px,96vw);border-radius:24px;border:1px solid rgba(177,194,251,.22);background:linear-gradient(180deg,#1b1f38e6,#0e111fe6);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);box-shadow:0 28px 54px #0b0e2073;position:relative;z-index:1}.gate-card{padding:1.8rem;display:flex;flex-direction:column;gap:1rem}.gate-card h1{margin:.1rem 0 0;font-size:clamp(2rem,7vw,2.8rem)}.gate-copy{margin:0;max-width:42ch}.gate-actions{display:flex;flex-wrap:wrap;gap:.6rem}.gate-actions .btn{text-decoration:none}.gate-hint{margin:0;color:#cdd8fb;font-size:.9rem}.auth-shell{width:min(430px,96vw);display:flex;flex-direction:column;align-items:flex-start;gap:.9rem;z-index:1}.card{width:100%;padding:1.4rem;display:flex;flex-direction:column;gap:.85rem}.card-auth h1{margin:0;font-size:1.4rem}.card label{display:flex;flex-direction:column;gap:.38rem;font-size:.86rem}.card input,.add-form input,.add-form textarea{width:100%;padding:.62rem .72rem;border-radius:12px;border:1px solid rgba(146,162,219,.32);background:#101425f2;color:#edf2ff;font:inherit}.card input:focus,.add-form input:focus,.add-form textarea:focus{outline:2px solid rgba(128,151,255,.55);outline-offset:1px}.dashboard{min-height:100vh;display:flex;flex-direction:column;background:radial-gradient(circle at top right,#292f69,#0f1328 42%,#070910)}.top-bar{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.85rem 1rem;border-bottom:1px solid rgba(163,182,246,.25);background:#070a14b8;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.brand-topbar{display:flex;align-items:center;gap:.7rem}.brand-mark{width:2rem;height:2rem;border-radius:.6rem;display:grid;place-items:center;font-weight:700;color:#fff;background:linear-gradient(150deg,#6280ff,#b05dff);box-shadow:0 8px 18px #6a6cff59}.user-email{font-size:.78rem}.layout{flex:1;min-height:0;display:grid;grid-template-columns:minmax(290px,360px) 1fr;gap:.8rem;padding:.8rem}.sidebar{border:1px solid rgba(164,182,245,.22);border-radius:16px;background:#0e1222c2;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);padding:1rem;overflow:auto}.sidebar h2{margin:0}.hint{margin:.45rem 0 1rem;line-height:1.4}.add-form{display:flex;flex-direction:column;gap:.56rem;margin-bottom:1rem}.conn-list{list-style:none;margin:0;padding:0}.conn-list li{display:flex;align-items:center;gap:.3rem;margin-bottom:.44rem}.conn{flex:1;text-align:left;padding:.56rem .66rem;border-radius:10px;border:1px solid rgba(143,161,225,.25);background:#0a0e1ee6;color:inherit;cursor:pointer}.conn.active{border-color:#9cb8ffcc;background:linear-gradient(145deg,#5763a880,#41348180)}.icon-del{width:2rem;height:2rem;border:0;border-radius:10px;background:#6e7bb426;color:#c6d4ff;cursor:pointer;font-size:1.15rem}.icon-del:hover{color:#ffd4d9;background:#ff809133}.main{min-height:0;border:1px solid rgba(164,181,243,.2);border-radius:16px;overflow:hidden;background:#050812d9}.empty-main{min-height:100%;display:grid;place-items:center;padding:1.5rem}.terminal-wrap{height:100%;min-height:0;display:flex;flex-direction:column}.terminal-toolbar{display:flex;align-items:center;gap:.75rem;padding:.5rem .75rem;background:#151a30e6;border-bottom:1px solid rgba(140,158,217,.24);font-size:.85rem}.status-idle{color:#a9b7df}.status-connecting{color:#ffd27c}.status-live{color:#87e8b0}.status-error{color:#ff9db0}.terminal-container{flex:1;min-height:360px;padding:.6rem}.terminal-container .xterm{height:100%}.terminal-container .xterm-viewport{overflow-y:auto!important}@media(max-width:900px){.layout{grid-template-columns:1fr;grid-template-rows:auto 1fr}.sidebar{max-height:45vh}}
