/**
 * 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}@font-face{font-family:Mona Sans;src:url(https://cdn.jsdelivr.net/gh/github/mona-sans@2.0.27/fonts/webfonts/variable/MonaSansVF%5Bopsz%2Cwght%5D.woff2) format("woff2");font-weight:200 900;font-display:swap;font-style:normal}@font-face{font-family:Mona Sans Mono;src:url(https://cdn.jsdelivr.net/gh/github/mona-sans@2.0.27/fonts/webfonts/variable/MonaSansMonoVF%5Bwght%5D.woff2) format("woff2");font-weight:200 900;font-display:swap;font-style:normal}:root{--gh-canvas: #0a0c0b;--gh-surface: #101411;--gh-surface-2: #161b17;--gh-surface-3: #1c221d;--gh-border: rgba(255, 255, 255, .1);--gh-border-strong: #232925;--gh-fg: #f2f5f3;--gh-fg-muted: #b6bfb8;--gh-fg-subtle: #909692;--gh-green: #0fbf3e;--gh-green-bright: #5fed83;--gh-green-press: #08872b;--gh-green-soft: rgba(15, 191, 62, .14);--gh-purple: #b870ff;--gh-blue: #3094ff;--gh-danger: #fe4c25;--gh-radius: 8px;--gh-radius-lg: 14px;--font-sans: "Mona Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;--font-mono: "Mona Sans Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace}*{box-sizing:border-box}html,body,#root{height:100%}body{margin:0;background:var(--gh-canvas);color:var(--gh-fg);font-family:var(--font-sans);font-size:15px;line-height:1.45;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}button{font-family:inherit;color:inherit;cursor:pointer}input,textarea{font-family:inherit}h1,h2,h3{margin:0}.app{display:flex;flex-direction:column;height:100dvh;max-width:760px;margin:0 auto;background:var(--gh-canvas);border-inline:1px solid var(--gh-border)}@media (max-width: 760px){.app{border-inline:0}}.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;padding-top:max(10px,env(safe-area-inset-top));border-bottom:1px solid var(--gh-border);background:linear-gradient(var(--gh-surface),var(--gh-canvas));position:sticky;top:0;z-index:5}.topbar__left{display:flex;align-items:center;gap:10px;min-width:0}.topbar__brand{display:inline-flex}.topbar__titles{display:flex;flex-direction:column;min-width:0}.topbar__title{font-weight:640;font-size:15px;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.topbar__crumb{font-size:12px;color:var(--gh-fg-subtle);font-family:var(--font-mono);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.topbar__status{border:0;background:transparent;padding:8px;border-radius:999px}.iconbtn{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:8px;border:1px solid var(--gh-border);background:var(--gh-surface);color:var(--gh-fg-muted);transition:background .12s,color .12s}.iconbtn:hover{background:var(--gh-surface-2);color:var(--gh-fg)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:40px;padding:0 16px;border-radius:8px;border:1px solid var(--gh-border-strong);background:var(--gh-surface-2);color:var(--gh-fg);font-weight:560;font-size:14px;transition:background .12s,border-color .12s,opacity .12s}.btn:hover{background:var(--gh-surface-3)}.btn:disabled{opacity:.5;cursor:not-allowed}.btn--primary{background:var(--gh-green);border-color:transparent;color:#04130a;font-weight:680}.btn--primary:hover{background:var(--gh-green-bright)}.btn--ghost{background:transparent;border-color:var(--gh-border);color:var(--gh-fg-muted)}.btn--ghost:hover{background:var(--gh-surface-2);color:var(--gh-fg)}.btn--block{width:100%}.btn--sm{height:32px;padding:0 10px;font-size:13px}.screen{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:14px}.screen__head{display:flex;align-items:center;justify-content:space-between}.screen__title{font-size:13px;text-transform:uppercase;letter-spacing:.08em;color:var(--gh-fg-subtle);font-weight:620}.card{background:var(--gh-surface);border:1px solid var(--gh-border);border-radius:var(--gh-radius-lg);padding:14px}.list{display:flex;flex-direction:column;gap:8px}.listitem{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:12px 14px;border-radius:var(--gh-radius);border:1px solid var(--gh-border);background:var(--gh-surface);transition:background .12s,border-color .12s}.listitem:hover:not(:disabled){background:var(--gh-surface-2);border-color:var(--gh-border-strong)}.listitem:disabled{opacity:.55;cursor:not-allowed}.listitem__icon{display:inline-flex;color:var(--gh-fg-subtle)}.listitem__main{display:flex;flex-direction:column;min-width:0;flex:1}.listitem__title{font-weight:580;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.listitem__sub{font-size:12px;color:var(--gh-fg-subtle);font-family:var(--font-mono);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chev{color:var(--gh-fg-subtle);display:inline-flex}.status-dot{width:9px;height:9px;border-radius:999px;background:var(--gh-fg-subtle);box-shadow:0 0 0 3px #ffffff0a;flex:none}.status-dot.is-online{background:var(--gh-green);box-shadow:0 0 0 3px var(--gh-green-soft)}.status-dot.is-offline{background:#3a423c}.status-dot.is-connecting{background:var(--gh-blue)}.badge{font-family:var(--font-mono);font-size:11px;padding:3px 8px;border-radius:999px;border:1px solid var(--gh-border);color:var(--gh-fg-muted);text-transform:lowercase;white-space:nowrap}.badge--green{color:var(--gh-green-bright);border-color:#0fbf3e59;background:var(--gh-green-soft)}.badge--muted{color:var(--gh-fg-subtle)}.badge--purple{color:var(--gh-purple);border-color:#b870ff59}.field{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}.label{font-size:12px;color:var(--gh-fg-muted);font-weight:560}.input{height:42px;padding:0 12px;border-radius:8px;background:var(--gh-canvas);border:1px solid var(--gh-border-strong);color:var(--gh-fg);font-size:15px;outline:none;transition:border-color .12s,box-shadow .12s;width:100%}.input:focus{border-color:var(--gh-green);box-shadow:0 0 0 3px var(--gh-green-soft)}.empty{padding:28px 16px;text-align:center;color:var(--gh-fg-subtle);border:1px dashed var(--gh-border-strong);border-radius:var(--gh-radius-lg);font-size:14px;line-height:1.6}.newsession__row{display:flex;gap:8px;margin-top:8px}.newsession__row .input{flex:1}.connect{min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:20px}.connect__card{width:100%;max-width:380px;background:var(--gh-surface);border:1px solid var(--gh-border);border-radius:18px;padding:22px}.brand{display:flex;align-items:center;gap:10px;font-weight:700;font-size:18px;letter-spacing:-.02em}.connect__sub{margin:8px 0 18px;color:var(--gh-fg-subtle);font-size:14px}.session{flex:1;display:flex;flex-direction:column;min-height:0}.terminal{flex:1;min-height:0;padding:8px 10px;background:var(--gh-canvas)}.terminal .xterm{height:100%}.composer{border-top:1px solid var(--gh-border);background:var(--gh-surface);padding:10px 10px calc(10px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:8px}.composer__bar{display:flex;align-items:center;justify-content:space-between}.seg{display:inline-flex;padding:3px;gap:3px;background:var(--gh-canvas);border:1px solid var(--gh-border);border-radius:9px}.seg__btn{border:0;background:transparent;color:var(--gh-fg-subtle);font-size:13px;font-weight:560;padding:5px 12px;border-radius:7px;transition:background .12s,color .12s}.seg__btn.is-active{background:var(--gh-surface-3);color:var(--gh-fg);box-shadow:inset 0 0 0 1px var(--gh-border)}.composer__row{display:flex;align-items:flex-end;gap:8px}.textarea{flex:1;resize:none;max-height:140px;min-height:44px;padding:11px 12px;border-radius:12px;background:var(--gh-canvas);border:1px solid var(--gh-border-strong);color:var(--gh-fg);font-size:15px;line-height:1.4;outline:none}.textarea:focus{border-color:var(--gh-green);box-shadow:0 0 0 3px var(--gh-green-soft)}.mic,.send{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:12px;flex:none;transition:background .12s,color .12s;border:1px solid var(--gh-border-strong);background:var(--gh-surface-2);color:var(--gh-fg-muted)}.mic:hover{color:var(--gh-fg);background:var(--gh-surface-3)}.mic.is-listening{color:#04130a;background:var(--gh-green);border-color:transparent;animation:pulse 1.4s infinite}.send{background:var(--gh-green);border-color:transparent;color:#04130a}.send:disabled{opacity:.45;cursor:not-allowed;background:var(--gh-surface-2);color:var(--gh-fg-subtle)}@keyframes pulse{0%,to{box-shadow:0 0 0 0 var(--gh-green-soft)}50%{box-shadow:0 0 0 8px transparent}}.approval{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border-top:1px solid rgba(254,76,37,.35);background:#fe4c2514}.approval__text{display:flex;flex-direction:column;gap:3px;min-width:0}.approval__label{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--gh-danger);font-weight:620}.approval__cmd{font-family:var(--font-mono);font-size:12px;color:var(--gh-fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.approval__actions{display:flex;gap:8px;flex:none}.newsession__model{margin-top:8px}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--gh-border-strong);border-radius:999px;border:2px solid var(--gh-canvas)}::-webkit-scrollbar-track{background:transparent}
