/**
 * 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{color-scheme:dark;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;background:#070a0f;color:#d8e1ea}:root[data-theme=light]{color-scheme:light;background:#f4f6f8;color:#16202a}*{box-sizing:border-box}html,body,#root{width:100%;height:100%;margin:0}body{overflow:hidden}button,input,select,textarea{font:inherit}button{color:inherit}.app-shell{height:100dvh;display:grid;grid-template-columns:260px minmax(0,1fr);background:#070a0f}.app-shell.sidebar-collapsed{grid-template-columns:0 minmax(0,1fr)}.app-shell.sidebar-collapsed>.session-sidebar{overflow:hidden;border-right-width:0}:root[data-theme=light] .app-shell{background:#f4f6f8}.workspace{min-width:0;min-height:0;display:grid;grid-template-rows:44px minmax(0,1fr);background:#090d13}:root[data-theme=light] .workspace{background:#eef2f6}.topbar,.sidebar-head{height:44px;display:flex;align-items:center;gap:8px;border-bottom:1px solid #1c2633;background:#101722;padding:0 10px}:root[data-theme=light] .topbar,:root[data-theme=light] .sidebar-head{border-bottom-color:#d5dce5;background:#fff}.title-block{min-width:0;display:flex;align-items:center;gap:8px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.top-actions{margin-left:auto;display:flex;align-items:center;gap:6px;min-width:0}.top-actions select{height:30px;max-width:130px;border:1px solid #2a3544;border-radius:6px;background:#0b111a;color:#d8e1ea;padding:0 6px}.attach-policy{height:30px;display:flex;grid-template-columns:none;align-items:center;gap:6px;color:#9fb1c5;font-size:12px}.attach-policy span{white-space:nowrap}:root[data-theme=light] .top-actions select{background:#f7f9fb;border-color:#cbd4df;color:#16202a}.session-sidebar{min-height:0;border-right:1px solid #1c2633;background:#0d131c;display:grid;grid-template-rows:44px minmax(0,1fr)}:root[data-theme=light] .session-sidebar{background:#fff;border-right-color:#d5dce5}.sidebar-head{justify-content:space-between;font-weight:700}.icon-group,.dialog-actions{display:flex;align-items:center;gap:6px}.session-list{min-height:0;overflow:auto;padding:8px}.session-group{display:grid;gap:3px}.session-item{width:100%;min-height:42px;display:grid;grid-template-columns:minmax(0,1fr) 28px 14px auto;align-items:center;gap:6px;border:1px solid transparent;border-radius:7px;background:transparent;padding:6px;text-align:left}.session-item:hover,.session-item.active{background:#162130;border-color:#263850}:root[data-theme=light] .session-item:hover,:root[data-theme=light] .session-item.active{background:#e8eef5;border-color:#cbd8e6}.session-main{min-width:0;display:grid;gap:1px}.session-name,.session-sub{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.session-name{font-weight:650}.session-sub,.session-meta{color:#8b9bad;font-size:12px}.attach-dot{width:8px;height:8px;border-radius:50%;background:#4b5564}.attach-dot.on{background:#38d77a}.row-actions{display:flex;opacity:0;pointer-events:none}.session-item:hover .row-actions,.session-item.active .row-actions{opacity:1;pointer-events:auto}.target-tree{display:grid;gap:2px;margin:0 0 8px 8px;padding-left:9px;border-left:1px solid #263347}.target-window,.target-pane-list{display:grid;gap:2px}.target-pane-list{margin-left:12px}.target-row{width:100%;min-width:0;height:28px;display:grid;align-items:center;gap:6px;border:1px solid transparent;border-radius:6px;background:transparent;color:#aab8c8;padding:0 7px;text-align:left}.target-window-row{grid-template-columns:16px minmax(0,1fr) 24px;font-weight:650}.target-pane-row{grid-template-columns:12px 18px minmax(0,1fr);font-size:12px}.target-row:hover,.target-row.active{background:#141f2e;border-color:#263850;color:#e0e9f2}:root[data-theme=light] .target-tree{border-left-color:#cbd8e6}:root[data-theme=light] .target-row{color:#536170}:root[data-theme=light] .target-row:hover,:root[data-theme=light] .target-row.active{background:#edf3f8;border-color:#cbd8e6;color:#16202a}.target-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.target-count,.target-pane-index{color:#7f8fa1;font-size:11px;text-align:right}.target-branch{width:10px;height:1px;background:#3a4656}.mini-icon{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border-radius:5px;color:#a8b4c2}.mini-icon:hover{background:#243143}.mini-icon.danger:hover{color:#ff8e8e}.icon-button,.toggle-button,.text-button,.primary-button,.ghost-button,.danger-button{border:1px solid #2a3544;border-radius:7px;background:#111925;color:#d8e1ea;min-height:30px;display:inline-flex;align-items:center;justify-content:center;gap:6px;cursor:pointer}:root[data-theme=light] .icon-button,:root[data-theme=light] .toggle-button,:root[data-theme=light] .text-button,:root[data-theme=light] .ghost-button{background:#fff;color:#16202a;border-color:#cbd4df}.icon-button{width:32px;height:32px;padding:0}.icon-button:disabled{opacity:.45;cursor:default}.toggle-button,.text-button{padding:0 9px}.toggle-button.on,.icon-button.accent{border-color:#42b883;color:#9ff3c6}.text-button.compact{min-width:36px}.logout-all{padding:0 9px}.primary-button{background:#176b87;border-color:#2293b7;color:#f7fbff;padding:0 13px}.danger-button{background:#7f1d1d;border-color:#b23b3b;color:#fff6f6;padding:0 13px}.ghost-button{padding:0 13px}.terminal-area{min-width:0;min-height:0;width:100%;height:100%;position:relative;display:grid;background:#070a0f;overflow:hidden}.terminal-container{min-width:0;min-height:0;width:100%;height:100%;overflow:hidden}.terminal-container .xterm{width:100%;height:100%}.terminal-container .xterm-screen,.terminal-container .xterm-helpers{width:100%!important}.terminal-container .xterm-screen{height:100%!important}.terminal-container .xterm-viewport{width:100%!important}.terminal-tools{position:absolute;right:10px;bottom:10px;display:flex;align-items:center;gap:6px;padding:5px;border:1px solid #1d2836;border-radius:8px;background:#0b111ad1;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);transition:transform .16s ease}.terminal-tools.closed{transform:translate(calc(100% - 42px))}.terminal-tools-panel{display:flex;align-items:center;gap:6px}.terminal-tools-toggle{flex:0 0 auto}.terminal-metrics{height:32px;display:inline-flex;align-items:center;padding:0 7px;border-right:1px solid #293647;color:#93a4b8;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;white-space:nowrap}.status-bar{min-width:96px;max-width:180px;height:26px;display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid #2a3544;border-radius:999px;color:#9fb1c5;padding:0 9px;font-size:12px;white-space:nowrap}.status-attached{color:#9ff3c6;border-color:#2c7a50}.status-error,.status-detached{color:#ffb1b1;border-color:#8c3131}.readonly-pill{border-left:1px solid currentColor;padding-left:6px}.error-banner{position:absolute;z-index:5;top:54px;right:10px;max-width:min(520px,calc(100vw - 20px));border:1px solid #8c3131;border-radius:7px;background:#2a1111;color:#ffd5d5;padding:8px 10px}.empty-state{min-height:0;display:flex;align-items:center;justify-content:center}.login-screen{width:100%;min-height:100dvh;display:grid;place-items:center;background:#070a0f;padding:20px}.login-panel,.dialog,.audit-panel{width:min(380px,100%);border:1px solid #243143;border-radius:8px;background:#101722;padding:18px;box-shadow:0 18px 60px #0000005c}.login-panel{display:grid;gap:12px}.login-panel h1{margin:0;font-size:22px}.login-mark{width:40px;height:40px;border-radius:8px;background:#176b87;display:grid;place-items:center}label{display:grid;gap:5px;color:#a9b6c5;font-size:13px}input,textarea{min-width:0;border:1px solid #2a3544;border-radius:7px;background:#080d14;color:#edf4fb;padding:8px 9px}.check-row{display:flex;align-items:center}.form-error{margin:0;color:#ffb1b1}.dialog-backdrop,.drawer-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:20;background:#0000007a}.dialog-backdrop{display:grid;place-items:center;padding:16px}.dialog{display:grid;gap:12px}.dialog-title{display:flex;align-items:center;justify-content:space-between;gap:10px}.dialog-title h2,.dialog h2{margin:0;font-size:17px}.dialog p{margin:0;color:#a9b6c5}.dialog-actions{justify-content:flex-end}.audit-panel{width:min(780px,100%);max-height:min(680px,86dvh);display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px}.audit-list{min-height:0;overflow:auto;display:grid;gap:4px}.audit-row{display:grid;grid-template-columns:220px 150px minmax(0,1fr) 120px;gap:8px;border-bottom:1px solid #202b39;padding:6px 0;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px}.audit-row span{min-width:0;overflow:hidden;text-overflow:ellipsis}.recovery-codes{margin:0;border:1px solid #2a3544;border-radius:7px;background:#080d14;padding:10px}.drawer-wrap,.mobile-only{display:none}.desktop-only{display:inline-flex}@media(max-width:780px){.app-shell,.app-shell.sidebar-collapsed{grid-template-columns:minmax(0,1fr)}.app-shell>.session-sidebar{display:none}.mobile-only{display:inline-flex}.desktop-only{display:none}.topbar{grid-template-columns:auto minmax(0,1fr);gap:6px;padding:0 6px;font-size:12px}.title-block{flex:1;gap:5px;font-size:12px}.top-actions{gap:3px}.top-actions .attach-policy,.top-actions .text-button{display:none}.toggle-button{width:30px;height:30px;min-height:30px;padding:0;font-size:0}.icon-button{width:30px;height:30px;min-height:30px}.status-bar{min-width:68px;max-width:92px;height:24px;padding:0 6px;font-size:11px}.terminal-tools{right:8px;bottom:8px}.terminal-metrics{display:none}.drawer-wrap{display:block;pointer-events:none}.drawer-wrap.open{pointer-events:auto}.drawer-wrap:not(.open) .drawer-backdrop{opacity:0}.session-drawer{position:fixed;z-index:21;inset:0 auto 0 0;width:min(88vw,330px);transform:translate(-100%);transition:transform .16s ease}.drawer-wrap.open .session-drawer{transform:translate(0)}.drawer-close{position:absolute;z-index:2;top:6px;right:6px}.audit-row{grid-template-columns:minmax(0,1fr)}}
