/**
 * 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;--bg: #111;--panel: #1a1a1a;--line: #2a2a2a;--fg: #e6e6e6;--dim: #9aa0a6;--acc: #7aa2f7;--warn: #e0af68;--err: #f7768e;--ok: #9ece6a}*{box-sizing:border-box}html,body,#root{height:100%}body{margin:0;background:var(--bg);color:var(--fg);font:14px/1.45 -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif}#root{display:flex;flex-direction:column}h2{font-size:18px;margin:0 0 10px}h2 small,li small{color:var(--dim);font-weight:400;font-size:12px}a{color:var(--acc)}button,.btn{background:#232a35;color:var(--fg);border:1px solid var(--line);border-radius:8px;padding:8px 10px;font-size:14px;cursor:pointer;text-decoration:none}button:disabled{opacity:.45;cursor:default}input,select,textarea{background:var(--panel);color:var(--fg);border:1px solid var(--line);border-radius:8px;padding:8px;font:inherit}nav{display:flex;gap:4px;padding:6px;background:var(--panel);border-bottom:1px solid var(--line);overflow-x:auto}nav a{color:var(--dim);text-decoration:none;padding:8px 10px;border-radius:8px;white-space:nowrap}nav a.active{color:var(--fg);background:#26303f}main{flex:1;min-height:0;display:flex;flex-direction:column;padding:10px}.empty{color:var(--dim)}.errorbar{border-bottom:1px solid var(--err)}.errorbar .error{display:flex;gap:8px;align-items:center;padding:6px 10px;background:#3b1f24;color:#ffd7dd}.errorbar .error span{flex:1;word-break:break-word}ul{list-style:none;margin:0;padding:0}.sessions li,.machines li,.projects li{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:10px;border:1px solid var(--line);border-radius:10px;margin-bottom:8px;background:var(--panel)}.sessions li>a:first-child{flex:1;font-weight:600}.sessions li .status{color:var(--dim);font-size:12px}.sessions li.waiting{border-color:var(--warn);background:#241f14}.sessions li.busy .status{color:var(--acc)}.sessions li.dead .status,.sessions li.closed .status{color:var(--err)}.machines li.offline{color:var(--dim)}.machines li.online:before{content:"●";color:var(--ok)}.machines li.offline:before{content:"○"}.new-project{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}.projects li{justify-content:space-between}.session{flex:1;min-height:0;display:flex;flex-direction:column;gap:8px}.session header{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:space-between}.session header h2{margin:0}.session .actions{display:flex;gap:6px;flex-wrap:wrap}.chronicle{flex:1;min-height:0;overflow-y:auto;padding:8px;border:1px solid var(--line);border-radius:10px;background:var(--panel)}.turn{padding:6px 0;border-bottom:1px solid var(--line)}.turn:last-child{border-bottom:none}.turn.live{border-left:2px solid var(--acc);padding-left:8px}.msg{margin:4px 0;white-space:pre-wrap;word-break:break-word}.msg.user{color:var(--ok)}.tool{color:var(--dim);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;white-space:pre-wrap;word-break:break-all}.tool.err{color:var(--err)}.status{color:var(--dim);font-size:12px}.note{font-size:12px;color:var(--warn)}.note.error{color:var(--err)}.spinner{color:var(--acc);font-size:12px}.question{border:1px solid var(--warn);border-radius:10px;padding:8px;margin:6px 0;background:#241f14}.question .qhead{color:var(--dim);font-size:12px}.question .options{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}.keysbar{display:flex;gap:6px;overflow-x:auto;padding-bottom:2px}.keysbar button{min-width:44px;padding:8px 6px}.composer{display:flex;gap:8px;align-items:flex-end;padding-bottom:env(safe-area-inset-bottom)}.composer textarea{flex:1;resize:vertical}.terminal-panel{height:50vh;display:flex;flex-direction:column;border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#000}.terminal-head{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:4px 8px;background:var(--panel);color:var(--dim);font-size:12px}.terminal{flex:1;min-height:0;padding:4px}
