/**
 * 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}.uplot,.uplot *,.uplot *:before,.uplot *:after{box-sizing:border-box}.uplot{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5;width:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;-webkit-user-select:none;user-select:none}.u-over,.u-under{position:absolute}.u-under{overflow:hidden}.uplot canvas{display:block;position:relative;width:100%;height:100%}.u-axis{position:absolute}.u-legend{font-size:14px;margin:auto;text-align:center}.u-inline{display:block}.u-inline *{display:inline-block}.u-inline tr{margin-right:16px}.u-legend th{font-weight:600}.u-legend th>*{vertical-align:middle;display:inline-block}.u-legend .u-marker{width:1em;height:1em;margin-right:4px;background-clip:padding-box!important}.u-inline.u-live th:after{content:":";vertical-align:middle}.u-inline:not(.u-live) .u-value{display:none}.u-series>*{padding:4px}.u-series th{cursor:pointer}.u-legend .u-off>*{opacity:.3}.u-select{background:#00000012;position:absolute;pointer-events:none}.u-cursor-x,.u-cursor-y{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607D8B}.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607D8B}.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;background-clip:padding-box!important}.u-axis.u-off,.u-select.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-cursor-pt.u-off{display:none}:root{--bg: #0c0f14;--bg-panel: #141922;--bg-card: #1a2030;--border: #2a3245;--text: #dbe2ef;--muted: #8a94a8;--accent: #4f8cff;--green: #3ecf7a;--amber: #e8b33d;--red: #e5534b;color-scheme:dark}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.5 -apple-system,Segoe UI,Roboto,sans-serif}.layout{min-height:100vh;display:flex;flex-direction:column}.topbar{position:sticky;top:0;z-index:10;display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:0 1.2rem;height:56px;background:linear-gradient(180deg,#1a2030f2,#141922f2);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border-bottom:1px solid var(--border);box-shadow:0 1px 12px #00000059}.topbar-left{display:flex;align-items:center;gap:1.1rem;min-width:0}.topbar-right{display:flex;align-items:center;gap:.6rem}.brand{font-weight:700;font-size:1.05rem;letter-spacing:.01em;color:var(--text);text-decoration:none;display:inline-flex;align-items:center;gap:.45rem;margin-right:.4rem}.brand svg{color:var(--accent)}.brand:hover svg{filter:drop-shadow(0 0 6px rgba(79,140,255,.6))}.nav-link{color:var(--muted);text-decoration:none;font-size:.92rem;font-weight:600;padding:.35rem .7rem;border-radius:6px;transition:color .15s,background .15s}.nav-link:hover{color:var(--text);background:#ffffff0a}.nav-link.active{color:var(--text);background:#4f8cff24}.nav-sep{width:1px;height:22px;background:var(--border);margin:0 .3rem}.user-chip{text-decoration:none;display:inline-flex;align-items:center;gap:.45rem;color:var(--muted);font-size:.9rem;padding:.25rem .6rem .25rem .25rem;border:1px solid var(--border);border-radius:999px;background:var(--bg-card)}.user-chip:hover{color:var(--text);border-color:var(--accent)}.avatar{width:24px;height:24px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--accent),#7c5cff);color:#fff;font-size:.75rem;font-weight:700}.login h2{display:flex;align-items:center;justify-content:center;gap:.45rem}.login h2 svg{color:var(--accent)}.btn svg{margin-right:.15rem}.card-stats svg{color:var(--muted);margin-right:.15rem}main{flex:1;padding:1.5rem;max-width:1100px;width:100%;margin:0 auto}.btn{display:inline-block;padding:.42rem .9rem;background:var(--bg-card);color:var(--text);border:1px solid var(--border);border-radius:6px;cursor:pointer;font-size:.9rem;text-decoration:none}.btn:hover:not(:disabled){border-color:var(--accent)}.btn:disabled{opacity:.4;cursor:default}.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}.btn.danger{border-color:var(--red);color:var(--red)}.btn.armed{background:var(--red);border-color:var(--red);color:#fff}.btn.ghost{background:transparent}.field{display:flex;flex-direction:column;gap:.25rem;margin-bottom:.9rem}.field>span{font-weight:600;font-size:.85rem}.field input:not([type=checkbox]),.field select{padding:.45rem .6rem;background:var(--bg);border:1px solid var(--border);border-radius:6px;color:var(--text);font-size:.92rem}.field input:focus,.field select:focus{outline:none;border-color:var(--accent)}.field.check{flex-direction:row;align-items:center;gap:.5rem}.req{color:var(--red);font-style:normal}.narrow{max-width:560px}.muted{color:var(--muted)}.error,.danger-text{color:var(--red)}.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:1rem}.card{background:var(--bg-card);border:1px solid var(--border);border-radius:10px;padding:1rem;display:flex;flex-direction:column;gap:.6rem}.card-head{display:flex;justify-content:space-between;align-items:center}.card-title{font-weight:700;font-size:1.02rem;color:var(--text);text-decoration:none}.card-title:hover{color:var(--accent)}.card-meta{display:flex;gap:.6rem;align-items:center;color:var(--muted);font-size:.82rem;flex-wrap:wrap}.card-actions,.actions{display:flex;gap:.5rem;flex-wrap:wrap;margin:.4rem 0}.card-stats{display:flex;gap:1rem;font-size:.88rem;color:var(--text)}.badge{background:var(--bg);border:1px solid var(--border);border-radius:4px;padding:.05rem .4rem;font-size:.75rem}.pill{padding:.15rem .6rem;border-radius:999px;font-size:.78rem;font-weight:600}.pill-running{background:#3ecf7a26;color:var(--green)}.pill-stopped{background:#8a94a826;color:var(--muted)}.pill-failed{background:#e5534b26;color:var(--red)}.pill-installing,.pill-starting,.pill-stopping,.pill-update{background:#e8b33d26;color:var(--amber)}.panel{background:var(--bg-panel);border:1px solid var(--border);border-radius:10px;padding:1.2rem}.detail-head{display:flex;justify-content:space-between;align-items:flex-start}.detail-head h2{margin:0 0 .3rem}.icon-btn{background:none;border:none;padding:0;cursor:pointer;color:var(--muted);vertical-align:baseline}.icon-btn:hover{color:var(--text)}.name-edit{font-size:inherit;font-weight:inherit;font-family:inherit;color:var(--text);background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:0 .4rem}.tabs{display:flex;gap:.2rem;border-bottom:1px solid var(--border);margin:.8rem 0 1rem}.tab{background:none;border:none;color:var(--muted);padding:.5rem .9rem;cursor:pointer;font-size:.92rem;border-bottom:2px solid transparent}.tab.active{color:var(--text);border-bottom-color:var(--accent)}.banner{background:#e8b33d1f;border:1px solid rgba(232,179,61,.4);color:var(--amber);padding:.5rem .8rem;border-radius:6px;margin-bottom:.8rem}.seg{display:inline-flex;border:1px solid var(--border);border-radius:6px;overflow:hidden}.seg button{background:transparent;border:none;color:var(--muted);padding:.35rem .8rem;cursor:pointer;font-size:.88rem}.seg button+button{border-left:1px solid var(--border)}.seg button.active{background:var(--accent);color:#fff}.seg button:disabled{opacity:.4;cursor:default}.dropzone{margin:.6rem 0;padding:1.4rem 1rem;text-align:center;cursor:pointer;border:2px dashed var(--border);border-radius:8px;color:var(--muted);transition:border-color .15s,background .15s}.dropzone:hover,.dropzone.over{border-color:var(--accent);background:#4f8cff14;color:var(--text)}.dropzone.busy{cursor:progress;opacity:.7}.dropzone b{color:var(--text)}.dropzone small{display:block;margin-top:.3rem}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:50;background:#0000008c;display:flex;align-items:center;justify-content:center;padding:1rem}.modal{background:var(--bg-panel);border:1px solid var(--border);border-radius:10px;width:min(900px,100%);max-height:90vh;display:flex;flex-direction:column;box-shadow:0 12px 40px #00000080}.modal-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.7rem 1rem;border-bottom:1px solid var(--border)}.modal-head h3{margin:0;font-size:1rem}.modal-head code{color:var(--muted);font-size:.8rem}.modal-body{padding:.8rem 1rem;overflow:auto;flex:1;display:flex}.modal-foot{display:flex;align-items:center;gap:.5rem;padding:.7rem 1rem;border-top:1px solid var(--border)}.modal-foot .spacer{flex:1}.editor{width:100%;min-height:50vh;resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.85rem;line-height:1.4;background:var(--bg);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:.6rem;-moz-tab-size:4;tab-size:4;white-space:pre;overflow:auto}.editor:focus{outline:none;border-color:var(--accent)}.ts-results{list-style:none;margin:.6rem 0 0;padding:0;display:grid;gap:.5rem}.ts-item{display:flex;gap:.8rem;align-items:flex-start;padding:.6rem .7rem;background:var(--bg-panel);border:1px solid var(--border);border-radius:8px}.ts-item img{width:48px;height:48px;border-radius:6px;flex:none;background:var(--bg)}.ts-item .body{flex:1;min-width:0}.ts-item .title{display:flex;gap:.5rem;align-items:baseline;flex-wrap:wrap}.ts-item .title a{color:var(--text);font-weight:600;text-decoration:none}.ts-item .title a:hover{color:var(--accent)}.ts-item .title a.author{color:var(--muted);font-weight:400;text-decoration:underline dotted}.ts-item .title a.author:hover{color:var(--accent)}.ts-item .desc{color:var(--muted);font-size:.85rem;margin:.15rem 0 0;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.ts-item .meta{color:var(--muted);font-size:.78rem;margin-top:.25rem;display:flex;gap:.6rem;flex-wrap:wrap}.ts-item .act{display:flex;flex-direction:column;gap:.3rem;align-items:flex-end;flex:none}.ts-search{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center}.ts-search input[type=text]{flex:1;min-width:220px;padding:.45rem .6rem;background:var(--bg);border:1px solid var(--border);border-radius:6px;color:var(--text)}.ts-search select{padding:.4rem;background:var(--bg);color:var(--text);border:1px solid var(--border);border-radius:6px}.mods-section{margin-top:1.4rem}.mods-section h3{margin:0;font-size:.95rem}.mods-section h3 code{color:var(--muted);font-weight:400;font-size:.8rem;margin-left:.5rem}.mods-section .table{margin-top:.5rem}.jobbar{display:flex;align-items:center;gap:.8rem;background:#4f8cff1a;border:1px solid rgba(79,140,255,.35);padding:.5rem .8rem;border-radius:6px;margin:.6rem 0}.jobbar progress{flex:1}.console-term{height:420px;background:#10141b;border-radius:8px;padding:.5rem}.console-bar{display:flex;align-items:center;gap:.6rem;margin-top:.5rem}.console-bar input{flex:1;padding:.45rem .6rem;background:var(--bg);border:1px solid var(--border);border-radius:6px;color:var(--text)}.console-bar .btn{white-space:nowrap}.console-filters{margin-top:.5rem;padding:.6rem .8rem;background:var(--bg-panel);border:1px solid var(--border);border-radius:8px}.console-filters .row{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}.console-filters input[type=text]{flex:1;min-width:200px;padding:.4rem .6rem;background:var(--bg);border:1px solid var(--border);border-radius:6px;color:var(--text)}.console-filters ul{list-style:none;margin:.5rem 0 0;padding:0;display:flex;flex-wrap:wrap;gap:.4rem}.console-filters li{display:inline-flex;align-items:center;gap:.3rem;max-width:100%;padding:.15rem .3rem .15rem .6rem;border:1px solid var(--border);border-radius:999px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.8rem}.console-filters li span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:420px}.console-filters li button{background:none;border:none;color:var(--muted);cursor:pointer;padding:0 .2rem}.console-filters li button:hover{color:var(--red)}.dot{width:9px;height:9px;border-radius:50%;display:inline-block}.dot.ok{background:var(--green)}.dot.bad{background:var(--red)}.table{width:100%;border-collapse:collapse;margin-top:1rem}.table th,.table td{text-align:left;padding:.5rem .6rem;border-bottom:1px solid var(--border)}.table th{color:var(--muted);font-size:.8rem;text-transform:uppercase;letter-spacing:.04em}.table td.actions{display:flex;gap:.4rem}.login-wrap{display:flex;justify-content:center;align-items:center;min-height:100vh}.login{width:320px}.login h2{text-align:center;margin-top:0}.login .btn{width:100%}.chart{margin:1rem 0}.chart .u-title{color:var(--text);font-size:.9rem}.empty{text-align:center;margin-top:4rem;color:var(--muted)}.empty h2{color:var(--text)}.reports-layout{display:grid;grid-template-columns:280px 1fr;gap:1rem;align-items:start}@media (max-width: 800px){.reports-layout{grid-template-columns:1fr}}.report-links{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.25rem}.report-link{display:flex;flex-direction:column;gap:.1rem;padding:.5rem .6rem;border-radius:6px;color:var(--text);text-decoration:none;border:1px solid transparent}.report-link:hover{background:#ffffff0a}.report-link.active{background:#4f8cff24;border-color:var(--border)}.report-title{font-weight:600;font-size:.92rem}.report-view{min-width:0}.report-md{line-height:1.55}.report-md h1{font-size:1.25rem}.report-md h2{font-size:1.05rem;margin-top:1.4rem}.report-md h3{font-size:.95rem;margin-top:1.1rem}.report-md code{background:var(--bg-card);border:1px solid var(--border);border-radius:4px;padding:.05rem .3rem;font-size:.85em}.report-md pre.report-code{background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:.7rem .9rem;overflow-x:auto}.report-md pre.report-code code{background:none;border:none;padding:0;font-size:.8rem}.report-md hr{border:none;border-top:1px solid var(--border);margin:1.2rem 0}.report-log{background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:.7rem .9rem;overflow-x:auto;font-size:.8rem;line-height:1.45;white-space:pre-wrap;word-break:break-word}.badge.ok{border-color:var(--green);color:var(--green)}.badge.bad{border-color:var(--red);color:var(--red)}
