/**
 * 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-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{font-family:monospace;-webkit-user-select:text;user-select:text;white-space:pre}.xterm .xterm-accessibility-tree>div{transform-origin:left;width:fit-content}.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}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{position:absolute;display:none}.xterm .xterm-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}:root{color-scheme:dark;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;--bg: #0a0e1a;--panel: #111827;--surface: #1e293b;--border: #334155;--muted: #94a3b8;--ok: #34d399;--primary: #6366f1;--primary-hover: #4f46e5;--danger: #ef4444;--text: #e2e8f0;--text-dim: #94a3b8}*,*:before,*:after{box-sizing:border-box}html,body,#app,.terminal-layout,.statusbar,.mobile-input-wrap,.btn-group,.arrow-group,.topbar,.topbar-row,.topbar-detail{max-width:100vw;overflow-x:hidden}html,body,#app{margin:0;width:100%;height:100%;background:var(--bg);color:var(--text);overflow:hidden;overflow-x:hidden;-webkit-text-size-adjust:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.page{min-height:100%;display:flex;align-items:center;justify-content:center;padding:24px}.card{width:100%;max-width:420px;background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:28px;box-shadow:0 4px 24px #00000040}.card h1{font-size:20px;font-weight:600;margin-bottom:20px;color:#f1f5f9}.field{display:grid;gap:6px;margin-bottom:16px}.field label{font-size:13px;color:var(--text-dim);font-weight:500}input{width:100%;background:var(--bg);color:#f3f4f6;border:1px solid var(--border);border-radius:8px;padding:10px 14px;font-size:14px;transition:border-color .2s,box-shadow .2s}input:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px #6366f126}button{background:var(--primary);color:#fff;border:0;border-radius:8px;padding:10px 16px;cursor:pointer;min-height:40px;font-size:14px;font-weight:500;transition:background .15s}button:hover{background:var(--primary-hover)}.error{color:#f87171;margin-top:8px;font-size:13px;min-height:18px}.terminal-layout{height:100dvh;display:grid;grid-template-rows:auto minmax(0,1fr) auto}.topbar{display:flex;flex-direction:column;gap:6px;padding:10px 16px;background:var(--panel);border-bottom:1px solid var(--border)}.statusbar{display:flex;flex-direction:column;gap:8px;padding:10px 12px;background:var(--panel);border-top:1px solid var(--border);padding-bottom:calc(10px + env(safe-area-inset-bottom));max-height:min(45dvh,340px);overflow-y:auto;overflow-x:hidden}.topbar-row,.topbar-detail{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.topbar.collapsed .topbar-detail{display:none}.topbar-row strong{font-size:15px;font-weight:600;color:#f1f5f9}.tag{padding:3px 10px;border-radius:999px;font-size:11px;font-weight:500;background:#34d3991a;color:var(--ok);border:1px solid rgba(52,211,153,.2)}.spacer{flex:1}.link-btn{background:transparent;border:1px solid var(--border);color:var(--text-dim);min-height:32px;font-size:13px;border-radius:6px;padding:4px 12px;transition:background .15s,border-color .15s}.link-btn:hover{background:var(--surface);border-color:#475569}.hint{color:var(--muted);font-size:12px}#terminal{width:100%;height:100%;min-height:0}#terminal .xterm,#terminal .xterm-screen{height:100%!important}.mobile-input-wrap{display:flex;flex-wrap:wrap;gap:6px;width:100%;max-width:100%;min-width:0;align-items:center;overflow:hidden}.mobile-input{flex:1 1 200px;min-width:0;font-size:14px;min-height:42px}.mobile-btn{min-height:44px;padding:6px 12px;font-size:13px;font-weight:500;border-radius:6px;white-space:nowrap}.btn-group{display:flex;gap:8px;flex-wrap:wrap;padding:4px;border-radius:8px;background:var(--surface);border:1px solid var(--border)}.arrow-group{display:flex;gap:4px;padding:4px;border-radius:8px;background:var(--surface);border:1px solid var(--border)}.arrow-btn{background:#334155;border-radius:6px;min-width:38px;min-height:44px;transition:background .15s}.arrow-btn:hover{background:#475569}.cmd-btn{background:var(--primary);border-radius:6px;transition:background .15s}.cmd-btn:hover{background:var(--primary-hover)}.ctrl-btn{background:var(--surface);border:1px solid var(--border);color:var(--text-dim);border-radius:6px;transition:background .15s}.ctrl-btn:hover{background:#334155;color:var(--text)}.danger-btn{background:transparent;border:1px solid rgba(239,68,68,.3);color:#f87171;border-radius:6px}.danger-btn:hover{background:#ef44441a}.btn-primary{background:#4f46e5;color:#fff;border:1px solid transparent}.btn-primary:hover{background:#4338ca}.btn-secondary{background:#334155;color:#e2e8f0;border:1px solid #475569}.btn-secondary:hover{background:#3f4f67}.btn-ghost{background:transparent;color:var(--text-dim);border:1px solid #475569}.btn-ghost:hover{background:#47556933;color:var(--text)}.btn-danger{background:transparent;border:1px solid rgba(239,68,68,.3);color:#f87171}.btn-danger:hover{background:#ef44441a}.oc-modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;display:none;align-items:center;justify-content:center;background:#020617b8;z-index:1200}.oc-modal-backdrop.show{display:flex}.oc-modal{width:min(92vw,420px);background:#0f172a;border:1px solid #334155;border-radius:12px;padding:20px;box-shadow:0 0 0 1px #6366f133,0 16px 48px #0f172abf}.oc-modal h3{margin:0 0 8px;font-size:18px;color:#f1f5f9}.oc-modal p{margin:0;color:#94a3b8;font-size:14px;line-height:1.6}.oc-modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}.conn-tag{position:relative}.conn-tag.is-connecting{background:#6366f11f;color:#a5b4fc;border-color:#6366f159;padding-left:24px}.conn-tag.is-connecting:before{content:"";position:absolute;left:8px;top:50%;width:10px;height:10px;margin-top:-5px;border-radius:999px;border:2px solid rgba(148,163,184,.25);border-top-color:var(--primary);animation:spin .9s linear infinite}.conn-tag.is-online{background:#34d3991a;color:var(--ok);border-color:#34d3994d}.conn-tag.is-offline{background:#94a3b81a;color:#cbd5e1;border-color:#94a3b847}@keyframes spin{to{transform:rotate(360deg)}}@media (max-width: 840px){.topbar{padding-top:calc(10px + env(safe-area-inset-top))}}@media (max-width: 500px){.topbar{padding:6px 4px;padding-top:calc(6px + env(safe-area-inset-top))}.topbar-row,.topbar-detail{gap:4px}.link-btn{padding:4px 8px;font-size:12px;min-height:28px}.tag{padding:2px 6px;font-size:10px}.topbar-row strong{font-size:13px}.spacer{flex:0 1 auto;min-width:0}}@media (max-width: 640px){.statusbar{padding-left:4px;padding-right:4px}.mobile-input-wrap{gap:4px}.mobile-input{flex:1 1 0%;font-size:16px;min-height:44px}.mobile-btn{flex:0 0 auto;min-height:44px;font-size:13px;padding:6px;min-width:0}.btn-group{flex:1 1 100%;justify-content:center;padding:2px;border:none;gap:4px;overflow:hidden;max-width:100%}.arrow-group{flex:1 1 100%;justify-content:center;padding:2px;border:none;gap:2px;overflow:hidden;max-width:100%}.btn-group .mobile-btn{flex:1 1 0%;min-width:0;text-align:center}.arrow-btn{flex:1 1 0%;min-width:0;min-height:44px}.hint{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:45vw}}@media (max-width: 374px){.statusbar{padding-left:2px;padding-right:2px}.mobile-btn{font-size:12px;padding:6px 4px;min-width:0}.btn-group,.arrow-group{gap:2px;padding:1px}}
