/**
 * 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{--bg: #0b0c10;--surface: #14161d;--border: #23262f;--text: #e9ecf2;--muted: #6b7382;--accent: #7c6cff;--accent-hover: #9387ff;--success: #3fc79a;--danger: #f26470;--font-sans: "Inter", system-ui, sans-serif;--font-mono: "JetBrains Mono", ui-monospace, monospace;--radius: 10px}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font-sans);font-size:14px;line-height:1.5}a{color:var(--accent);text-decoration:none}.center{min-height:100vh;display:grid;place-items:center;padding:16px}.card{width:100%;max-width:380px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:28px}.card h1{font-size:20px;margin:0 0 4px}.sub{color:var(--muted);margin:0 0 20px}label{display:block;font-size:12px;color:var(--muted);margin:14px 0 6px}input{width:100%;background:var(--bg);border:1px solid var(--border);border-radius:8px;color:var(--text);padding:10px 12px;font:inherit}input:focus{outline:none;border-color:var(--accent)}button{width:100%;margin-top:20px;background:var(--accent);color:#fff;border:0;border-radius:8px;padding:10px 12px;font:inherit;font-weight:500;cursor:pointer}button:hover{background:var(--accent-hover)}button:disabled{opacity:.6;cursor:default}button.ghost{width:auto;margin:0;background:transparent;border:1px solid var(--border);color:var(--text)}.error{color:var(--danger);margin-top:14px}.ok{color:var(--success)}.mono{font-family:var(--font-mono);font-size:12px}.shell{min-height:100vh;display:grid;grid-template-columns:220px 1fr}.sidebar{background:var(--surface);border-right:1px solid var(--border);padding:20px 16px}.sidebar .brand{font-weight:600;margin-bottom:24px}.sidebar .brand span{color:var(--accent)}.main{padding:28px}.main h1{margin-top:0}.panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:20px;max-width:560px}.panel+.panel{margin-top:16px}.row{display:flex;gap:8px;align-items:end}.row>*{flex:1}.row button{flex:0 0 auto;width:auto;margin:0}select{width:100%;background:var(--bg);border:1px solid var(--border);border-radius:8px;color:var(--text);padding:10px 12px;font:inherit}textarea{width:100%;background:var(--bg);border:1px solid var(--border);border-radius:8px;color:var(--text);padding:10px 12px;font:inherit;resize:vertical}textarea:focus,select:focus{outline:none;border-color:var(--accent)}textarea.mono{font-family:var(--font-mono);font-size:12px}.nav{display:flex;flex-direction:column;gap:2px;margin-bottom:24px}.nav a{color:var(--muted);padding:6px 10px;border-radius:8px}.nav a:hover{color:var(--text)}.nav a.active{color:var(--text);background:var(--bg)}.split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start}.split .panel{max-width:none}.panel.wide{max-width:900px}.output{background:var(--bg);border:1px solid var(--border);border-radius:8px;padding:12px;margin:12px 0 0;white-space:pre-wrap;word-break:break-word;font-family:var(--font-mono);font-size:12px;max-height:60vh;overflow:auto}.req{color:var(--accent)}.opt{color:var(--muted)}.help{color:var(--muted);font-size:12px;margin-top:4px}.error.tight{margin-top:4px;font-size:12px}.actions{display:flex;gap:8px;margin-top:12px}.actions button,button.inline{width:auto;margin-top:0}button.inline{margin-top:16px}.panel button.ghost{margin-top:12px}.actions button.ghost,.listrow button.ghost{margin-top:0}button.danger{color:var(--danger)}.listrow{display:flex;justify-content:space-between;align-items:center;padding:6px 0;gap:12px}.listrow .actions{margin-top:0}.chips{display:flex;flex-wrap:wrap;gap:6px}button.chip{width:auto;margin:0;padding:4px 10px;background:var(--bg);border:1px solid var(--border);color:var(--muted);font-size:12px}button.chip.on{border-color:var(--accent);color:var(--text)}.slotrow{display:grid;grid-template-columns:1fr 1fr 110px auto;gap:6px;margin-top:8px;padding:10px;border:1px solid var(--border);border-radius:8px}.slotrow>input[aria-label="slot help"],.slotrow>input[aria-label="slot options"]{grid-column:span 3}.slotrow button{margin:0}label.check{display:flex;align-items:center;gap:6px;margin:0;white-space:nowrap}label.check input{width:auto}.gauge{margin-top:12px;padding:12px;border:1px solid var(--border);border-radius:8px;background:var(--bg)}.gauge-head{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;align-items:baseline}.gauge-track{height:6px;border-radius:3px;background:var(--border);margin-top:8px;overflow:hidden}.gauge-fill{height:100%;background:var(--accent)}.gauge.warn .gauge-fill{background:#e0a43a}.gauge.over .gauge-fill{background:var(--danger)}.gauge.over{border-color:var(--danger)}.gauge-warn{margin-top:10px;font-size:13px}.gauge-warn ul{margin:6px 0;padding-left:18px}.gauge-msg{margin-top:12px;color:var(--muted);font-size:12px}.tabs{margin-bottom:16px}.tabs button.chip{text-transform:capitalize}.statgrid{display:flex;gap:12px;margin:12px 0}.stat{flex:1;padding:12px;background:var(--bg);border:1px solid var(--border);border-radius:8px}.statnum{font-size:24px;font-weight:600}.pill{font-family:var(--font-mono);font-size:11px;padding:1px 8px;border-radius:10px;border:1px solid var(--border);color:var(--muted)}.pill.open,.pill.pending{color:var(--accent);border-color:var(--accent)}.pill.released,.pill.succeeded{color:var(--success);border-color:var(--success)}.pill.failed{color:var(--danger);border-color:var(--danger)}.pill.partial{color:#e0a43a;border-color:#e0a43a}.pill.in_progress,.pill.promoted{color:var(--accent);border-color:var(--accent)}.pill.done{color:var(--success);border-color:var(--success)}.pill.rejected{color:var(--danger);border-color:var(--danger)}.shots{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.shot{max-width:160px;max-height:110px;border:1px solid var(--border);border-radius:8px;display:block}.colhead{text-transform:capitalize;color:var(--muted);font-size:12px;margin:14px 0 4px}.feature{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 0;border-top:1px solid var(--border)}.feature .actions{margin-top:0;align-items:center}.feature select{width:auto;padding:6px 8px}.tightsub{margin:0;font-size:12px}.listrow.clickable{cursor:pointer;border-top:1px solid var(--border)}.logrow{margin-top:12px}.logrow button{margin-top:0}.runner{display:grid;grid-template-columns:240px minmax(0,1fr);gap:16px;align-items:start}.runner-tabs{display:flex;flex-direction:column;gap:6px}.runner-tab{display:flex;flex-direction:column;gap:2px;padding:10px 12px;background:var(--surface);border:1px solid var(--border);border-radius:8px;color:var(--text)}.runner-tab.active{border-color:var(--accent)}.runner-tab.new{color:var(--accent)}.tab-top{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.dot{width:8px;height:8px;border-radius:50%;background:var(--muted)}.dot.running{background:var(--success)}.runner-content{min-width:0}.runner-main{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:14px}.runner-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}.term-wrap{background:var(--bg);border:1px solid var(--border);border-radius:8px;padding:8px}.term{height:62vh;min-height:320px}.approvals{display:flex;flex-direction:column;gap:8px;margin-bottom:10px}.approval{border:1px solid var(--info, #52a8ff);border-radius:8px;padding:10px 12px;background:var(--bg)}.approval-head{display:flex;justify-content:space-between;align-items:center;gap:8px}.approval-body{margin:8px 0 0;white-space:pre-wrap;word-break:break-word;max-height:160px;overflow:auto;color:var(--text)}.approval .pill.pending{color:#52a8ff;border-color:#52a8ff}@media (max-width: 900px){.runner{grid-template-columns:1fr}}.chat-new{display:flex;flex-direction:column;gap:6px;max-width:420px}.chat-new button{width:auto;align-self:flex-start;margin-top:8px}.check{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:13px}.check input{width:auto}.chat-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:190px}.chat-del{align-self:flex-start;padding:2px 8px;font-size:11px;margin-top:6px}.chat-thread .panel,.chat-thread{max-width:none}.chat-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.chat-head select{width:auto;padding:6px 8px}.chat-messages{display:flex;flex-direction:column;gap:10px;margin:14px 0;max-height:52vh;overflow:auto}.bubble{padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:var(--bg);max-width:85%}.bubble.user{align-self:flex-end;border-color:var(--accent)}.bubble-role{color:var(--muted);font-size:11px;margin-bottom:4px}.bubble-text{white-space:pre-wrap;word-break:break-word}.trace{margin-bottom:8px;font-size:12px}.trace .output{max-height:160px}.composer{display:flex;gap:8px;align-items:end}.composer textarea{flex:1}.composer button{width:auto;margin:0}.diff{background:var(--bg);border:1px solid var(--border);border-radius:8px;padding:8px 0;font-family:var(--font-mono);font-size:12px;max-height:50vh;overflow:auto}.dl{padding:0 12px;white-space:pre-wrap;word-break:break-word}.dl.add{background:#3fc79a1f;color:var(--success)}.dl.del{background:#f264701f;color:var(--danger)}.dl.hunk{color:var(--muted)}.settings-tabs{display:flex;gap:4px;border-bottom:1px solid var(--border);margin-bottom:24px}.settings-tabs .tab{background:transparent;color:var(--muted);border:0;border-bottom:2px solid transparent;border-radius:0;padding:10px 14px}.settings-tabs .tab:hover{color:var(--text);background:transparent}.settings-tabs .tab.active{color:var(--text);border-bottom-color:var(--accent)}
