/**
 * 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}.chat{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;overflow-wrap:anywhere;padding:14px 12px 18px;display:flex;flex-direction:column;gap:10px;background:radial-gradient(120% 60% at 50% 0%,rgba(15,191,62,.05),transparent 60%),var(--gh-canvas)}.chat__hint{margin:auto;text-align:center;color:var(--gh-fg-subtle);font-size:14px;line-height:1.6;max-width:280px}.chat__hint-sub{font-size:13px;margin-top:6px}.chat__hint strong{color:var(--gh-green-bright);font-family:var(--font-mono);padding:1px 6px;border:1px solid var(--gh-border-strong);border-radius:6px}.msg{display:flex;max-width:100%}.msg--user{justify-content:flex-end}.msg--assistant,.msg--error{justify-content:flex-start}.msg--system{justify-content:center}.bubble{max-width:86%;padding:9px 13px;border-radius:16px;font-size:15px;line-height:1.5;overflow-wrap:anywhere}.msg--user .bubble{background:var(--gh-green);color:#04130a;border-bottom-right-radius:5px;font-weight:540}.msg--assistant .bubble{background:var(--gh-surface-2);border:1px solid var(--gh-border);color:var(--gh-fg);border-bottom-left-radius:5px}.msg--error .bubble{background:#fe4c251a;border:1px solid rgba(254,76,37,.35);color:#ffb3a1;border-bottom-left-radius:5px;font-family:var(--font-mono);font-size:13px}.msg__system{font-size:12px;color:var(--gh-fg-subtle);background:var(--gh-surface);border:1px solid var(--gh-border);padding:4px 12px;border-radius:999px}.bubble .md-pre{margin:8px 0 2px;padding:10px 12px;background:var(--gh-canvas);border:1px solid var(--gh-border-strong);border-radius:10px;overflow-x:auto}.bubble .md-pre code{font-family:var(--font-mono);font-size:12.5px;line-height:1.5;color:var(--gh-fg);white-space:pre}.bubble .md-code{font-family:var(--font-mono);font-size:.88em;padding:1px 5px;border-radius:5px;background:#ffffff0f;border:1px solid var(--gh-border)}.msg--user .bubble .md-code{background:#00000029;border-color:#0000002e}.bubble--typing{display:inline-flex;gap:5px;align-items:center;padding:13px 15px}.bubble--typing .dot{width:7px;height:7px;border-radius:999px;background:var(--gh-fg-subtle);animation:typing 1.2s infinite ease-in-out}.bubble--typing .dot:nth-child(2){animation-delay:.18s}.bubble--typing .dot:nth-child(3){animation-delay:.36s}@keyframes typing{0%,60%,to{opacity:.25;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}.composer{position:relative;border-top:1px solid var(--gh-border);background:var(--gh-surface);padding:10px 10px calc(10px + env(safe-area-inset-bottom))}.composer--ended{text-align:center}.composer__ended{font-size:13px;color:var(--gh-fg-subtle)}.composer__row{display:flex;align-items:flex-end;gap:7px}.textarea{flex:1;resize:none;max-height:140px;min-height:44px;padding:11px 12px;border-radius:14px;background:var(--gh-canvas);border:1px solid var(--gh-border-strong);color:var(--gh-fg);font-size:16px;line-height:1.4;outline:none;transition:border-color .12s,box-shadow .12s}.textarea:focus{border-color:var(--gh-green);box-shadow:0 0 0 3px var(--gh-green-soft)}.cbtn{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:14px;flex:none;border:1px solid var(--gh-border-strong);background:var(--gh-surface-2);color:var(--gh-fg-muted);transition:background .12s,color .12s,transform .08s}.cbtn:active{transform:scale(.94)}.cbtn:hover{color:var(--gh-fg);background:var(--gh-surface-3)}.cbtn--slash{font-weight:700}.cbtn.is-listening{color:#04130a;background:var(--gh-green);border-color:transparent;animation:pulse 1.4s infinite}.cbtn--send{background:var(--gh-green);border-color:transparent;color:#04130a}.cbtn--send:disabled{opacity:.4;background:var(--gh-surface-2);color:var(--gh-fg-subtle);cursor:not-allowed}.cbtn--stop{background:var(--gh-danger);border-color:transparent;color:#fff}@keyframes pulse{0%,to{box-shadow:0 0 0 0 var(--gh-green-soft)}50%{box-shadow:0 0 0 8px transparent}}.slash-pop{position:absolute;left:10px;right:10px;bottom:calc(100% - 2px);margin-bottom:8px;background:var(--gh-surface-2);border:1px solid var(--gh-border-strong);border-radius:14px;box-shadow:0 12px 40px #00000080;overflow:hidden;max-height:260px;overflow-y:auto;z-index:20}.slash-item{display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:11px 13px;background:transparent;border:0;border-bottom:1px solid var(--gh-border)}.slash-item:last-child{border-bottom:0}.slash-item:hover,.slash-item:active{background:var(--gh-surface-3)}.slash-item__cmd{font-family:var(--font-mono);font-size:13px;font-weight:620;color:var(--gh-green-bright);flex:none;min-width:64px}.slash-item__text{display:flex;flex-direction:column;min-width:0}.slash-item__title{font-size:14px;font-weight:560;color:var(--gh-fg)}.slash-item__desc{font-size:12px;color:var(--gh-fg-subtle)}.sheet-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:30;background:#00000080;display:flex;align-items:flex-end;justify-content:center;animation:fade .15s ease}.sheet{width:100%;max-width:760px;background:var(--gh-surface);border-top-left-radius:20px;border-top-right-radius:20px;border:1px solid var(--gh-border);padding-bottom:env(safe-area-inset-bottom);max-height:70dvh;overflow-y:auto;animation:slideup .2s ease}.sheet__head{display:flex;align-items:center;justify-content:space-between;padding:14px 14px 8px;position:sticky;top:0;background:var(--gh-surface)}.sheet__title{font-size:13px;text-transform:uppercase;letter-spacing:.08em;color:var(--gh-fg-subtle);font-weight:620}.sheet__list{padding:0 8px 10px}.sheet .slash-item{border-radius:12px;border-bottom:0}@keyframes fade{0%{opacity:0}to{opacity:1}}@keyframes slideup{0%{transform:translateY(16px)}to{transform:translateY(0)}}.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}.btn--danger{background:var(--gh-danger);border-color:transparent;color:#fff}.btn--danger:hover{background:#ff6a47}.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}
