/**
 * 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{--teal-light: #8ff3dd;--teal: #2dd4bf;--teal-dark: #0c7a70;--deep: #062e2b;--ink: #06201e;--white: #ffffff}*{box-sizing:border-box}html,body,#root{overscroll-behavior:none;-webkit-tap-highlight-color:transparent;margin:0;padding:0;width:100%;height:100%;overflow:hidden;background:#eaf7f4;color:var(--ink);font-family:DejaVu Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Arial,sans-serif}.app{position:relative;width:100%;height:100%;overflow:hidden}.loading{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;background:linear-gradient(180deg,#eaf7f4,#c2e2dc)}.loading__mark{display:flex;align-items:flex-end;gap:6px;height:44px}.loading__bar{width:9px;height:26px;border-radius:3px;background:var(--teal);animation:rise 1.05s ease-in-out infinite}.loading__bar:nth-child(2){animation-delay:.16s;background:var(--teal-dark)}.loading__bar:nth-child(3){animation-delay:.32s;background:var(--teal-light)}@keyframes rise{0%,to{height:18px;opacity:.55}50%{height:44px;opacity:1}}.loading__label{font-size:13px;font-weight:700;letter-spacing:.42em;color:var(--teal-dark)}.legend{position:absolute;top:18px;left:18px;padding:14px 16px;border-radius:14px;background:#ffffffc7;border:1px solid rgba(12,122,112,.18);backdrop-filter:blur(10px);box-shadow:0 8px 26px #062e2b1f;pointer-events:none;user-select:none}.legend__title{font-size:12px;font-weight:700;letter-spacing:.34em;color:var(--teal-dark);margin-bottom:10px}.legend__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:7px}.legend__item{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--ink)}.legend__dot{width:7px;height:7px;border-radius:50%;background:var(--teal);flex:none}.legend__name{font-weight:600}.legend__count{color:#06201e8c;font-size:11px}@media(max-width:640px){.legend{top:10px;left:10px;padding:10px 12px}.legend__count{display:none}}@media(max-width:1024px){.camera-controls{top:10px;right:10px;padding:6px 10px}.zoom-level-label,.help-toggle .toggle-label{display:none}.help-toggle{padding:8px}.brand-label{font-size:12px}.floor-indicator{bottom:12px;right:12px;padding:8px 12px;min-width:120px}.floor-indicator .floor-name{font-size:14px}.control-hint{bottom:12px;left:12px;padding:8px 10px}.control-hint kbd{min-width:22px;height:22px;font-size:9px;padding:0 4px}}@media(max-width:480px){.floor-indicator{min-width:100px;padding:6px 10px}.floor-indicator .floor-dots{display:none}.floor-indicator .transition-info{font-size:9px}.help-panel{max-width:100%;margin:12px;border-radius:12px}.help-panel section{gap:8px}.key-row kbd{min-width:20px;height:20px;font-size:9px;padding:0 3px}}.touch-controls{position:fixed;inset:auto 0 0;height:0;z-index:120}.joystick{position:fixed;left:max(20px,env(safe-area-inset-left));bottom:max(20px,env(safe-area-inset-bottom));width:140px;height:140px;border-radius:50%;background:radial-gradient(circle,#062e2b59,#062e2b8c 70%);border:2px solid rgba(45,212,191,.7);box-shadow:0 6px 24px #00000040;display:flex;align-items:center;justify-content:center;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.joystick__knob{width:58px;height:58px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#8ff3dd,#2dd4bf 60%,#0c7a70);box-shadow:0 4px 14px #00000059;pointer-events:none;will-change:transform}.touch-action{position:fixed;right:max(22px,env(safe-area-inset-right));bottom:max(34px,env(safe-area-inset-bottom));width:92px;height:92px;border-radius:50%;border:2px solid #8ff3dd;background:#0c7a70eb;color:#eaf7f4;font:700 15px IBM Plex Mono,monospace;letter-spacing:.08em;box-shadow:0 6px 24px #0000004d;touch-action:none;user-select:none;-webkit-user-select:none}.touch-action:active{transform:scale(.94);background:#2dd4bf}.elevator-panel{position:fixed;left:50%;bottom:24px;transform:translate(-50%);z-index:110;display:flex;flex-direction:column;align-items:center;gap:8px;padding:10px 16px;background:#061e1df0;border:1px solid #2dd4bf;border-radius:12px;color:#eaf7f4;font-family:IBM Plex Mono,monospace;box-shadow:0 6px 28px #0006;user-select:none;-webkit-user-select:none;max-width:calc(100vw - 24px)}.elevator-panel__title{font-size:10px;font-weight:700;letter-spacing:.14em;color:#2dd4bf;white-space:nowrap}.elevator-panel__text{font-size:13px;white-space:nowrap}.elevator-panel__buttons{display:flex;gap:10px}.elevator-panel__floor,.elevator-panel__call{min-width:56px;height:56px;border-radius:50%;border:2px solid #0c7a70;background:#0e1615e6;color:#eaf7f4;font:700 18px IBM Plex Mono,monospace;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1;touch-action:manipulation}.elevator-panel__floor small{font-size:9px;font-weight:400;color:#5f9a93;margin-top:3px}.elevator-panel__floor.is-active{border-color:#8ff3dd;background:#0c7a70;box-shadow:0 0 14px #8ff3dd99}.elevator-panel__call{border-radius:8px;height:36px;font-size:12px;letter-spacing:.1em}.elevator-panel__floor:hover,.elevator-panel__call:hover{border-color:#8ff3dd}.debug-panel{position:fixed;left:12px;top:64px;z-index:300;min-width:240px;padding:10px 12px;background:#061413eb;border:1px solid #e74c3c;border-radius:8px;color:#eaf7f4;font:11px IBM Plex Mono,monospace}.debug-panel__head{display:flex;justify-content:space-between;margin-bottom:6px;color:#e74c3c}.debug-panel__head button{background:none;border:none;color:inherit;cursor:pointer}.debug-panel dl{margin:0;display:grid;gap:3px}.debug-panel dl div{display:flex;justify-content:space-between;gap:12px}.debug-panel dt{color:#5f9a93}.debug-panel dd{margin:0}@media(pointer:coarse){.floor-indicator{top:64px!important;bottom:auto!important;right:10px!important}.elevator-panel{bottom:max(20px,env(safe-area-inset-bottom))}}@media(pointer:coarse)and (max-width:520px){.elevator-panel{bottom:186px}.brand-label{display:none!important}}.computer{position:fixed;inset:0;z-index:400;display:flex;align-items:center;justify-content:center;padding:16px;background:#06201e8c;backdrop-filter:blur(3px)}.computer__frame{width:min(960px,100%);height:min(620px,100%);display:flex;flex-direction:column;background:#06201e;border:10px solid #1f2b2a;border-radius:14px;box-shadow:0 0 0 2px #2dd4bf,0 24px 60px #00000080;overflow:hidden;color:#eaf7f4;font:13px IBM Plex Mono,Menlo,Consolas,monospace}.computer__head{display:flex;align-items:center;justify-content:space-between;padding:6px 10px;background:#0c2f2c;border-bottom:1px solid #0c7a70}.computer__title{color:#8ff3dd;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.computer__close{background:none;border:1px solid #0c7a70;border-radius:6px;color:#eaf7f4;width:32px;height:28px;cursor:pointer}.computer__terminal{flex:1;min-height:0;padding:6px}.computer__msg,.computer__login{padding:20px 24px;line-height:1.6;overflow:auto}.computer__msg code{color:#8ff3dd}.computer__warn,.computer__error{color:#ffb4a8}.computer__login{display:flex;flex-direction:column;gap:10px;max-width:360px}.computer__login input{padding:10px 12px;border-radius:8px;border:1px solid #0c7a70;background:#0b2b28;color:#eaf7f4;font:inherit}.computer button[type=submit],.computer__msg button{padding:9px 14px;border-radius:8px;border:1px solid #2dd4bf;background:#0c7a70;color:#eaf7f4;font:inherit;cursor:pointer;align-self:flex-start}@media(max-width:640px){.computer{padding:0}.computer__frame{border-width:4px;border-radius:0;height:100%}}.editor-toggle{position:fixed;top:18px;left:146px;z-index:100;height:37px;padding:0 14px;border-radius:8px;border:1px solid #2dd4bf;background:#061e1deb;color:#8ff3dd;font:600 11px IBM Plex Mono,monospace;letter-spacing:.08em;cursor:pointer}.editor{position:fixed;top:70px;right:12px;bottom:12px;z-index:150;width:340px;display:flex;flex-direction:column;background:#061e1df5;border:1px solid #2dd4bf;border-radius:12px;color:#eaf7f4;font:12px IBM Plex Mono,monospace;box-shadow:0 10px 40px #00000073}.editor__head{display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid #0c7a70;color:#8ff3dd;letter-spacing:.08em}.editor__head button{margin-left:auto}.editor__save{font-size:10px;color:#5f9a93}.editor__save--saved{color:#8ff3dd}.editor__save--error,.editor__save--offline{color:#ffb4a8}.editor__body{flex:1;overflow-y:auto;padding:10px 12px 14px;display:flex;flex-direction:column;gap:14px}.editor h4{margin:0 0 8px;font-size:10px;letter-spacing:.14em;color:#2dd4bf}.editor button,.editor input,.editor select{font:inherit;color:#eaf7f4;background:#0b2b28;border:1px solid #0c7a70;border-radius:6px;padding:6px 9px;min-height:32px}.editor button{cursor:pointer}.editor button:hover:not(:disabled){border-color:#8ff3dd}.editor button:disabled{opacity:.4;cursor:default}.editor button.is-active,.editor li.is-active>.editor__prop-name{background:#0c7a70;border-color:#8ff3dd}.editor button.danger{border-color:#a8483c;color:#ffb4a8}.editor__chips,.editor__row{display:flex;gap:6px;flex-wrap:wrap;align-items:center}.editor__row>input,.editor__row>select{flex:1;min-width:0}.editor__row--wrap{margin-top:6px}.editor__grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.editor__grid label,.editor__door label{display:flex;flex-direction:column;gap:4px;font-size:10px;color:#5f9a93}.editor__stepper{display:flex;align-items:center;gap:8px;color:#eaf7f4;font-size:12px}.editor__door{margin-top:10px;padding:8px;border:1px dashed #0c7a70;border-radius:8px;display:flex;flex-direction:column;gap:6px}.editor__door input[type=range]{padding:0;min-height:0;accent-color:#2dd4bf}.editor__props{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:4px}.editor__props li{display:flex;flex-wrap:wrap;gap:4px;align-items:center}.editor__prop-name{flex:1;text-align:left}.editor__prop-tools{display:flex;gap:4px}.editor__prop-tools button{min-width:34px}.editor__hint{margin:6px 0 0;color:#5f9a93}.editor__notice{margin:0;color:#8ff3dd}.editor__error,.editor__problems{margin:0;color:#ffb4a8}.editor__problems{padding-left:0;list-style:none}.editor__ok{margin:0;color:#8ff3dd}.editor__reset{align-self:flex-start}@media(max-width:640px){.editor{inset:auto 0 0;width:auto;max-height:58vh;border-radius:14px 14px 0 0}.editor-toggle{left:72px}}.company-toggle{position:fixed;top:18px;left:240px;z-index:100;height:37px;padding:0 14px;border-radius:8px;border:1px solid #2dd4bf;background:#061e1deb;color:#8ff3dd;font:600 11px IBM Plex Mono,monospace;letter-spacing:.08em;cursor:pointer}.company-toggle__badge{margin-left:8px;padding:1px 7px;border-radius:10px;background:#ff9f43;color:#06201e;font-weight:700}.company{position:fixed;top:64px;left:12px;bottom:12px;z-index:160;width:min(560px,calc(100vw - 24px));display:flex;flex-direction:column;background:#061e1df7;border:1px solid #2dd4bf;border-radius:12px;color:#eaf7f4;font:12px IBM Plex Mono,monospace;box-shadow:0 10px 40px #00000073}.company__head{display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid #0c7a70;color:#8ff3dd;letter-spacing:.1em}.company__head strong{flex:1}.company__tabs{display:flex;gap:4px;padding:8px 10px;overflow-x:auto;border-bottom:1px solid #0c3f3b}.company__body{flex:1;overflow-y:auto;padding:10px 12px 16px;display:flex;flex-direction:column;gap:8px}.company h4{margin:10px 0 2px;font-size:10px;letter-spacing:.14em;color:#2dd4bf}.company h5{margin:8px 0 0;font-size:11px;color:#8ff3dd}.company button,.company input,.company select,.company textarea{font:inherit;color:#eaf7f4;background:#0b2b28;border:1px solid #0c7a70;border-radius:6px;padding:6px 9px}.company button{cursor:pointer;white-space:nowrap}.company button:disabled{opacity:.4;cursor:default}.company button.is-active{background:#0c7a70;border-color:#8ff3dd}.company button.danger{border-color:#a8483c;color:#ffb4a8}.company textarea{width:100%;resize:vertical}.company label{display:flex;flex-direction:column;gap:4px;font-size:10px;color:#5f9a93}.company label.co-check{flex-direction:row;align-items:center;gap:6px;font-size:11px;color:#eaf7f4}.co-row{display:flex;gap:6px;align-items:center}.co-row>input,.co-row>select{flex:1;min-width:0}.co-row--wrap{flex-wrap:wrap}.co-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.co-form{display:flex;flex-direction:column;gap:8px}.co-card{display:flex;flex-direction:column;gap:4px;padding:8px 10px;border:1px solid #0c3f3b;border-radius:8px;background:#0b2b2899;text-align:left}.co-card p{margin:2px 0}.company .co-card--button{white-space:normal}.co-card__head{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.co-dot{width:10px;height:10px;border-radius:50%}.co-tag{margin-left:auto;padding:1px 7px;border-radius:10px;font-size:10px;background:#0c3f3b;color:#8ff3dd}.co-tag--root,.co-tag--over-budget,.co-tag--failed{background:#5a221b;color:#ffb4a8}.co-tag--thinking,.co-tag--working,.co-tag--running,.co-tag--in_progress{background:#0c7a70;color:#eaf7f4}.co-cmd{margin:4px 0;padding:6px 8px;background:#031413;border-radius:6px;white-space:pre-wrap;word-break:break-word;max-height:220px;overflow:auto;color:#8ff3dd}.co-muted{color:#5f9a93;margin:0}.co-warn{color:#ffd29a;margin:0}.co-error{color:#ffb4a8;margin:0}.co-msg p{margin:2px 0 6px}.co-usage{display:flex;gap:10px;flex-wrap:wrap;font-size:10px;color:#5f9a93}.co-limits{display:flex;flex-direction:column;gap:4px;align-items:flex-start}.co-limits .co-row{width:100%}.co-table td{padding:2px 10px 2px 0}.co-log{margin:0;line-height:1.5}.npc-layer{position:fixed;inset:0;pointer-events:none;z-index:40;overflow:hidden}.npc-label{position:absolute;left:0;top:0;flex-direction:column;align-items:center;gap:4px;will-change:transform;font:11px IBM Plex Mono,monospace;white-space:nowrap}.npc-name{padding:1px 7px;border-radius:9px;border:1px solid #2dd4bf;background:#061e1dd9;color:#eaf7f4}.npc-name--thinking,.npc-name--working{box-shadow:0 0 0 2px #8ff3dd99;animation:npc-pulse 1.2s ease-in-out infinite}.npc-name--over-budget{background:#5a221b}@keyframes npc-pulse{50%{box-shadow:0 0 0 5px #8ff3dd1a}}.npc-bubble{max-width:220px;white-space:normal;padding:6px 9px;border-radius:10px;background:#fff;color:#06201e;box-shadow:0 4px 14px #00000040;font-size:11px;line-height:1.35}@media(max-width:640px){.company-toggle{left:150px;padding:0 10px}.company{top:auto;left:0;bottom:0;width:100%;max-height:75vh;border-radius:14px 14px 0 0}.co-grid{grid-template-columns:1fr}}.lang-toggle{position:fixed;top:18px;left:372px;z-index:100;height:37px;min-width:44px;padding:0 10px;border-radius:8px;border:1px solid #2dd4bf;background:#061e1deb;color:#8ff3dd;font:700 13px Vazirmatn,IBM Plex Mono,monospace;cursor:pointer}:root[lang=fa] body,:root[lang=fa] .company,:root[lang=fa] .editor,:root[lang=fa] .elevator-panel,:root[lang=fa] .computer__msg,:root[lang=fa] .computer__login,:root[lang=fa] .npc-label,:root[lang=fa] button,:root[lang=fa] input,:root[lang=fa] select,:root[lang=fa] textarea,:root[lang=fa] [role=dialog],:root[lang=fa] .floor-indicator,:root[lang=fa] .control-hint,:root[lang=fa] .help-toggle,:root[lang=fa] .camera-controls{font-family:Vazirmatn,IBM Plex Mono,sans-serif!important}:root[lang=fa] code,:root[lang=fa] pre,:root[lang=fa] kbd,:root[lang=fa] .co-cmd,:root[lang=fa] .computer__terminal,:root[lang=fa] .xterm{font-family:IBM Plex Mono,Menlo,Consolas,monospace!important;direction:ltr;text-align:left}:root[dir=rtl] .company,:root[dir=rtl] .editor{direction:rtl;text-align:right}:root[dir=rtl] .co-card{text-align:right}@media(max-width:640px){.company-toggle__text{display:none}.company-toggle{left:150px}.lang-toggle{top:64px;left:18px}.brand-label{display:none!important}}
