/**
 * 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: #0b0e14;--panel: #151a23;--panel-2: #1b222d;--border: #262d3a;--text: #d7dde5;--muted: #8b96a5;--accent: #d9822b;--accent-hover: #e8933b;--danger: #c0392b;--danger-hover: #d64535;--ok: #2ecc71}*{box-sizing:border-box}body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;background:var(--bg);color:var(--text)}h1,h2,h3{margin:0 0 .5rem}.muted{color:var(--muted)}.small{font-size:.8rem}.center{min-height:100vh;display:grid;place-items:center}.login-card{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:2rem;width:320px;display:flex;flex-direction:column;gap:1rem}.login-card label{display:flex;flex-direction:column;gap:.35rem;font-size:.85rem}input,select{background:var(--panel-2);border:1px solid var(--border);border-radius:8px;padding:.55rem .7rem;color:var(--text);font-size:.9rem}input:focus,select:focus{outline:none;border-color:var(--accent)}button{background:var(--accent);color:#10141b;border:none;border-radius:8px;padding:.55rem .9rem;font-weight:600;cursor:pointer}button:hover:not(:disabled){background:var(--accent-hover)}button:disabled{opacity:.5;cursor:default}.btn-ghost{background:transparent;border:1px solid var(--border);color:var(--text)}.btn-ghost:hover:not(:disabled){background:var(--panel-2)}.btn-danger{background:var(--danger);color:#fff}.btn-danger:hover:not(:disabled){background:var(--danger-hover)}.error{color:#ff8b7d;font-size:.85rem}.app{max-width:1200px;margin:0 auto;padding:1rem 1.25rem 3rem}.topbar{display:flex;justify-content:space-between;align-items:center;padding:.5rem 0 1rem;border-bottom:1px solid var(--border);margin-bottom:1.25rem}.topbar h1{font-size:1.15rem}.topbar-right{display:flex;align-items:center;gap:.75rem}.grid{display:grid;grid-template-columns:300px 1fr;gap:1.25rem}.panel{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:1.1rem}.span2{grid-column:1 / -1}.field{display:flex;flex-direction:column;gap:.35rem;font-size:.85rem;margin:.75rem 0}.field select{width:100%}.btn-row{display:flex;gap:.5rem}.status-badge{display:inline-block;padding:.25rem .6rem;border-radius:999px;font-size:.8rem;background:var(--panel-2);border:1px solid var(--border);margin-bottom:.5rem}.status-badge.running{border-color:var(--ok);color:var(--ok)}.status-badge.starting{border-color:var(--accent);color:var(--accent)}.status-badge.stopped,.status-badge.not-created{color:var(--muted)}.console-status{display:flex;align-items:center;gap:.4rem;font-size:.8rem;margin-bottom:.5rem}.dot{width:9px;height:9px;border-radius:50%;display:inline-block}.dot.on{background:var(--ok)}.dot.off{background:var(--danger)}.terminal{height:380px;background:#0d1117;border:1px solid var(--border);border-radius:8px;padding:.5rem}.mods-cols{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem}.mods-head{display:flex;justify-content:space-between;align-items:center}.upload-btn{padding:.35rem .7rem;border-radius:8px;cursor:pointer;font-size:.8rem}.search-row{display:flex;gap:.5rem;margin-bottom:.75rem}.search-row input{flex:1}.mod-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem;max-height:340px;overflow-y:auto}.mod-list li{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem;background:var(--panel-2);border:1px solid var(--border);border-radius:8px;padding:.6rem .75rem}@media (max-width: 860px){.grid,.mods-cols{grid-template-columns:1fr}}.server-select{display:flex;align-items:center;gap:.4rem}.server-select select{padding:.35rem .5rem}.tabs{display:flex;gap:.25rem;margin-bottom:1.25rem;border-bottom:1px solid var(--border)}.tab{background:transparent;color:var(--muted);border:none;border-bottom:2px solid transparent;border-radius:0;padding:.6rem 1rem;font-weight:600}.tab:hover:not(:disabled){background:transparent;color:var(--text)}.tab.active{color:var(--accent);border-bottom-color:var(--accent)}.servers-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.server-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:1rem;margin-bottom:1.25rem}.server-card{padding:1rem}.server-card.selected{border-color:var(--accent)}.server-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem;margin-bottom:.5rem}.server-stats{display:flex;gap:.5rem;margin:.25rem 0 .75rem}.stat{flex:1;display:flex;flex-direction:column;align-items:center;gap:.15rem;background:var(--panel-2);border:1px solid var(--border);border-radius:8px;padding:.45rem .3rem}.stat-value{font-size:1.05rem;font-weight:700;color:var(--text)}.stat-label{font-size:.68rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}.add-server{padding:1rem}.add-server-row{display:flex;flex-wrap:wrap;align-items:flex-end;gap:.75rem}.add-server-row .field{margin:0;flex:1;min-width:140px}.console-tab{display:grid;grid-template-columns:1fr 300px;gap:1.25rem;align-items:start}.console-main{padding:1rem}.compose{display:flex;gap:.5rem;margin-top:.75rem}.compose-input{flex:1;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.compose-args{display:flex;flex-wrap:wrap;gap:.75rem;margin-top:.6rem}.field.inline{flex-direction:column;margin:0;min-width:140px}.command-palette{padding:1rem;max-height:620px;overflow-y:auto}.command-group{margin-bottom:.75rem}.command-group-label{text-transform:uppercase;font-size:.7rem;letter-spacing:.05em;color:var(--muted);margin:.5rem 0 .35rem}.command-item{display:flex;flex-direction:column;align-items:flex-start;gap:.1rem;width:100%;text-align:left;background:var(--panel-2);color:var(--text);border:1px solid var(--border);border-radius:8px;padding:.45rem .6rem;margin-bottom:.35rem;font-weight:500}.command-item:hover:not(:disabled){background:#222a37;border-color:var(--accent)}.command-item.active{border-color:var(--accent)}.command-label{font-weight:600}.command-template{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}@media (max-width: 860px){.console-tab{grid-template-columns:1fr}}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#04060a99;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);display:grid;place-items:center;z-index:100}.modal-card{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:1.5rem;width:400px;max-width:calc(100vw - 2rem);box-shadow:0 12px 40px #00000073}.modal-title{margin:0 0 .6rem;font-size:1.05rem}.modal-message{margin:0 0 1.25rem;color:var(--muted);line-height:1.45}.modal-actions{display:flex;justify-content:flex-end;gap:.6rem}.notice{background:#d9822b1f;border:1px solid var(--accent);color:var(--accent-hover);border-radius:8px;padding:.55rem .75rem;font-size:.85rem;margin-bottom:.75rem}.config-page{max-width:900px}.config-head{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:.75rem}.config-section{margin-bottom:1.25rem}.config-section-title{font-size:.78rem;text-transform:uppercase;letter-spacing:.06em;color:var(--accent);margin:0 0 .5rem}.config-grid{display:grid;grid-template-columns:1fr 1fr;gap:.9rem;background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:1.1rem}.cfg-field{display:flex;flex-direction:column;gap:.35rem;font-size:.85rem;min-width:0}.cfg-field.span-2{grid-column:1 / -1}.cfg-field input,.cfg-field select,.cfg-field textarea{width:100%}.cfg-bool{flex-direction:row;align-items:center;gap:.5rem}.cfg-bool input{width:auto;accent-color:var(--accent)}.cfg-json{min-height:120px;background:#0d1117;color:var(--text);border:1px solid var(--border);border-radius:8px;padding:.6rem;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.78rem;resize:vertical}.cfg-json:focus{outline:none;border-color:var(--accent)}.cfg-default{font-weight:400}.cfg-label{font-size:.85rem}.roles-list{display:flex;flex-direction:column;gap:.75rem;margin-top:.35rem}.role-card{background:var(--panel-2);border:1px solid var(--border);border-radius:10px;padding:.85rem}.role-card-title{font-weight:700;margin-bottom:.6rem}.role-card .config-grid{background:transparent;border:none;padding:0;gap:.75rem}.config-raw{margin-top:1.25rem;background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:1rem 1.1rem}.config-raw summary{cursor:pointer;font-weight:600}.config-textarea{width:100%;min-height:320px;margin-top:.5rem;background:#0d1117;color:var(--text);border:1px solid var(--border);border-radius:8px;padding:.7rem;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.82rem;resize:vertical}.config-textarea:focus{outline:none;border-color:var(--accent)}@media (max-width: 720px){.config-grid{grid-template-columns:1fr}}
