/**
 * 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;inset: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;inset:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{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{--bg: #0c0d10;--surface: #14161b;--surface-2: #1c1f26;--border: #2a2e38;--fg: #e6e6e6;--muted: #98a2b3;--accent: #6c8eef;--accent-fg: #0c0d10;--danger: #e5484d;--ok: #30a46c;--row-h: 44px;--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;--font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace}*{box-sizing:border-box}html,body{height:100%;margin:0;background:var(--bg);color:var(--fg);font-family:var(--font-sans);font-size:15px;line-height:1.4;-webkit-text-size-adjust:100%}#app{height:100%;display:flex;flex-direction:column;overflow:hidden}a{color:inherit;text-decoration:none}code{font-family:var(--font-mono);font-size:.92em;padding:1px 4px;background:var(--surface-2);border-radius:3px}button,input,select,textarea{font-family:inherit;font-size:inherit;color:inherit}.btn{border:1px solid var(--border);background:var(--surface);color:var(--fg);padding:0 14px;height:36px;border-radius:8px;cursor:pointer;font-weight:500;min-height:36px;display:inline-flex;align-items:center;justify-content:center}.btn:hover{background:var(--surface-2)}.btn-primary{background:var(--accent);border-color:var(--accent);color:var(--accent-fg)}.btn-primary:hover{filter:brightness(1.08)}.btn-ghost{background:transparent}.btn-icon{width:36px;padding:0}.catalog{display:flex;flex-direction:column;height:100%;min-height:0}.catalog-header{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-bottom:1px solid var(--border);background:var(--surface);position:sticky;top:0;z-index:1}.catalog-header h1{margin:0;font-size:18px;letter-spacing:.02em}.catalog-actions{display:flex;flex:1 1 280px;gap:8px;align-items:center;justify-content:flex-end}.search{flex:1 1 220px;max-width:360px;height:36px;padding:0 12px;background:var(--surface-2);border:1px solid var(--border);border-radius:8px;outline:none}.search:focus{border-color:var(--accent)}.daemon-bar{padding:8px 16px;display:flex;flex-wrap:wrap;gap:6px;border-bottom:1px solid var(--border);background:var(--surface)}.daemon-chip{background:var(--surface-2);border:1px solid var(--border);border-radius:999px;padding:2px 10px;font-size:12px;color:var(--muted)}.daemon-empty{font-size:12px;color:var(--muted)}.tree{flex:1 1 auto;overflow:auto;padding:8px 0 24px}.empty{padding:24px 16px;color:var(--muted);text-align:center}.tree-folder{display:flex;flex-direction:column}.tree-folder-header{display:flex;align-items:center;gap:8px;background:transparent;border:0;width:100%;text-align:left;height:var(--row-h);padding-right:16px;color:var(--muted);cursor:pointer;font-size:13px;letter-spacing:.02em;text-transform:uppercase}.tree-folder-header:hover{background:var(--surface)}.tree-folder-header .chevron{width:14px;text-align:center;color:var(--muted)}.folder-name{flex:1 1 auto;color:var(--fg);text-transform:none;font-size:14px;letter-spacing:0}.folder-count{font-size:12px;color:var(--muted);padding:1px 8px;border-radius:999px;background:var(--surface-2)}.tree-leaf{display:flex;align-items:center;gap:10px;min-height:var(--row-h);padding:8px 16px 8px 8px;border-bottom:1px solid transparent;color:var(--fg)}.tree-leaf:hover{background:var(--surface)}.tree-leaf:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}.status{width:8px;height:8px;border-radius:50%;flex:0 0 8px;background:var(--muted)}.status-running{background:var(--ok)}.status-dead{background:var(--danger);opacity:.7}.leaf-main{display:flex;flex-direction:column;flex:1 1 auto;min-width:0}.leaf-name{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.leaf-meta{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.leaf-kill{background:transparent;color:var(--muted);border:1px solid transparent;border-radius:8px;width:36px;height:36px;cursor:pointer;flex:0 0 36px}.leaf-kill:hover{color:var(--danger);background:var(--surface-2);border-color:var(--border)}.attach{display:flex;flex-direction:column;height:100%;background:var(--bg)}.attach-header{display:flex;align-items:center;gap:12px;padding:8px 12px;border-bottom:1px solid var(--border);background:var(--surface)}.attach-header .back{font-size:18px;width:40px;height:36px}.attach-title{font-family:var(--font-mono);font-size:13px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1 1 auto}.attach-state{font-size:12px;padding:2px 8px;border-radius:999px;background:var(--surface-2);color:var(--muted);border:1px solid var(--border)}.attach-state[data-state=open]{color:var(--ok)}.attach-state[data-state=closed],.attach-state[data-state=error]{color:var(--danger)}.attach-body{flex:1 1 auto;min-height:0;padding:6px;display:flex;background:#101115}.attach-body .xterm{width:100%;height:100%}.attach-status{margin:16px;padding:12px 14px;border-radius:8px;background:var(--surface);border:1px solid var(--border);font-size:14px}.attach-status.status-error{border-color:var(--danger);color:var(--danger)}.modal-backdrop{position:fixed;inset:0;background:#0000008c;display:flex;align-items:flex-end;justify-content:center;padding:0;z-index:50}@media (min-width: 600px){.modal-backdrop{align-items:center;padding:24px}}.modal{background:var(--surface);border-radius:16px 16px 0 0;border:1px solid var(--border);width:100%;max-width:560px;max-height:90vh;display:flex;flex-direction:column}@media (min-width: 600px){.modal{border-radius:12px}}.modal-header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--border)}.modal-header h2{margin:0;font-size:16px}.modal-body{padding:16px;overflow:auto;display:flex;flex-direction:column;gap:12px}.modal-body label{display:flex;flex-direction:column;gap:4px;font-size:13px;color:var(--muted)}.modal-body label.row-inline{flex-direction:row;align-items:center;gap:8px;color:var(--fg);font-size:14px}.modal-body input[type=text],.modal-body select{background:var(--surface-2);border:1px solid var(--border);border-radius:8px;padding:10px 12px;color:var(--fg);font-size:15px;width:100%}.modal-body input[type=text]:focus,.modal-body select:focus{outline:none;border-color:var(--accent)}.worktree{border:1px solid var(--border);border-radius:8px;padding:12px;display:flex;flex-direction:column;gap:10px}.worktree legend{padding:0 6px;color:var(--fg)}.modal-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:8px}.form-error{color:var(--danger);margin:0;font-size:13px;min-height:1.2em}.not-found{padding:24px;display:flex;flex-direction:column;gap:12px;align-items:flex-start}@media (max-width: 480px){.catalog-header h1{font-size:16px}.catalog-actions{flex:1 1 100%;justify-content:stretch}.search{max-width:none}}
