/**
 * 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-primary: #1E1E1E;--bg-secondary: #252526;--bg-tertiary: #2D2D2D;--bg-elevated: #333333;--bg-hover: #3A3A3A;--bg-active: #094771;--text-primary: #D4D4D4;--text-secondary: #858585;--text-muted: #6B6B6B;--accent-primary: #007ACC;--accent-primary-hover: #2899F5;--accent-success: #4CAF50;--accent-error: #F44336;--accent-warning: #FFA500;--accent-folder: #DCDCAA;--accent-file: #9CDCFE;--border-color: #2A2A2A;--border-color-light: #3A3A3A;--border-color-focus: #007ACC;--font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;--font-size-xs: 10px;--font-size-sm: 12px;--font-size-md: 13px;--font-size-base: 14px;--font-size-lg: 16px;--font-weight-normal: 400;--font-weight-medium: 500;--font-weight-semibold: 600;--space-1: 4px;--space-2: 8px;--space-3: 12px;--space-4: 16px;--space-5: 20px;--space-6: 24px;--space-8: 32px;--topbar-height: 44px;--sidebar-width: 260px;--terminal-height: 200px;--mobile-toolbar-height: 56px;--radius-sm: 4px;--radius-md: 6px;--radius-lg: 8px;--radius-xl: 12px;--shadow-sm: 0 2px 8px rgba(0, 0, 0, .2);--shadow-md: 0 4px 16px rgba(0, 0, 0, .3);--shadow-lg: 0 8px 32px rgba(0, 0, 0, .4);--shadow-panel: 4px 0 20px rgba(0, 0, 0, .4);--transition-fast: .15s ease;--transition-normal: .25s ease;--transition-slow: .35s ease;--z-base: 1;--z-dropdown: 50;--z-overlay: 90;--z-panel: 100;--z-modal: 200;--z-toast: 300;--z-toolbar: 1000}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body{height:100%;overflow:hidden;background-color:var(--bg-primary);color:var(--text-primary);font-family:var(--font-mono);font-size:var(--font-size-base);line-height:1.5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#root{height:100%}.loading-screen{display:flex;justify-content:center;align-items:center;height:100vh;height:100dvh;background-color:var(--bg-primary);color:var(--text-primary);font-family:var(--font-mono);font-size:var(--font-size-lg)}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:var(--bg-primary)}::-webkit-scrollbar-thumb{background-color:var(--border-color-light);border-radius:var(--radius-sm);border:2px solid var(--bg-primary)}::-webkit-scrollbar-thumb:hover{background-color:var(--bg-hover)}::-webkit-scrollbar-corner{background:var(--bg-primary)}*{scrollbar-width:thin;scrollbar-color:var(--border-color-light) var(--bg-primary)}.playground{display:flex;flex-direction:column;height:100vh;height:100dvh;overflow:hidden;position:relative;background-color:var(--bg-primary)}.subterm-topbar{display:flex;align-items:center;justify-content:space-between;height:var(--topbar-height);padding:0 var(--space-4);background:linear-gradient(180deg,var(--bg-secondary) 0%,var(--bg-primary) 100%);border-bottom:1px solid var(--border-color);flex-shrink:0;z-index:var(--z-base)}.subterm-topbar .logo{display:flex;align-items:center;gap:var(--space-2)}.subterm-topbar .logo-text{color:var(--accent-primary);font-size:var(--font-size-lg);font-weight:var(--font-weight-semibold);letter-spacing:-.02em}.subterm-topbar .actions,.desktop-only{display:flex;align-items:center;gap:var(--space-2)}.mobile-only{display:none}.container{display:flex;flex:1;min-height:0;overflow:hidden;position:relative}.files{display:flex;flex-direction:column;width:var(--sidebar-width);min-width:200px;max-width:400px;height:100%;background-color:var(--bg-primary);border-right:1px solid var(--border-color);overflow:hidden;flex-shrink:0;transition:transform var(--transition-normal),width var(--transition-normal)}.files .selected-file-label{display:flex;justify-content:space-between;align-items:center;padding:var(--space-2) var(--space-3);gap:var(--space-3);background-color:var(--bg-secondary);border-bottom:1px solid var(--border-color);min-height:40px;flex-shrink:0}.files .selected-file-label .file-name{color:var(--text-primary);font-size:var(--font-size-md);font-weight:var(--font-weight-medium);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.files .selected-file-label .file-name.empty{color:var(--text-secondary)}.files .file-actions{display:flex;gap:var(--space-1);flex-shrink:0}.files .file-tree-wrapper{flex:1;overflow-y:auto;overflow-x:hidden}.file-tree-item{display:flex;align-items:center;padding:var(--space-1) var(--space-3);cursor:pointer;border-radius:var(--radius-sm);transition:background-color var(--transition-fast);-webkit-user-select:none;user-select:none}.file-tree-item:hover{background-color:var(--bg-hover)}.file-tree-item.selected{background-color:var(--bg-active)}.file-tree-item .icon{display:flex;align-items:center;justify-content:center;width:16px;height:16px;margin-right:var(--space-2);flex-shrink:0}.file-tree-item .name{font-size:var(--font-size-md);color:var(--text-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.files .inline-create-form{display:flex;align-items:center;padding:var(--space-1) var(--space-3);gap:var(--space-2);background-color:var(--bg-secondary);border-bottom:1px solid var(--border-color)}.files .inline-create-form input{flex:1;min-width:0;padding:var(--space-1) var(--space-2);background-color:var(--bg-tertiary);border:1px solid var(--border-color-focus);border-radius:var(--radius-sm);color:var(--text-primary);font-family:var(--font-mono);font-size:var(--font-size-md);outline:none}.files .inline-create-form input::placeholder{color:var(--text-muted)}.panel-close-btn{display:none;position:absolute;top:var(--space-2);right:var(--space-2);width:32px;height:32px;padding:0;background-color:var(--bg-hover);border:none;border-radius:var(--radius-md);color:var(--text-primary);cursor:pointer;align-items:center;justify-content:center;z-index:var(--z-dropdown);transition:background-color var(--transition-fast)}.panel-close-btn:hover{background-color:var(--bg-elevated)}.editor{flex:1;min-width:0;height:100%;background-color:var(--bg-primary);overflow:hidden;position:relative}.editor .monaco-editor,.editor .overflow-guard{border-radius:0!important}.terminal{background-color:var(--bg-primary);border-top:1px solid var(--border-color);padding:var(--space-3);height:var(--terminal-height);min-height:100px;max-height:50vh;overflow:hidden;transition:height var(--transition-normal),max-height var(--transition-normal);flex-shrink:0}.terminal-mobile-header{display:none;justify-content:space-between;align-items:center;padding:var(--space-2) var(--space-3);margin:calc(-1 * var(--space-3));margin-bottom:var(--space-2);border-bottom:1px solid var(--border-color-light)}.terminal-mobile-header .title{color:var(--accent-primary);font-weight:var(--font-weight-semibold);font-size:var(--font-size-md)}#terminal{width:100%;height:100%;overflow:auto;scrollbar-width:none;-ms-overflow-style:none}#terminal::-webkit-scrollbar{display:none}.custom-button{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);padding:var(--space-2) var(--space-3);background-color:var(--accent-primary);color:#fff;border:none;border-radius:var(--radius-md);font-family:var(--font-mono);font-size:var(--font-size-md);font-weight:var(--font-weight-medium);cursor:pointer;transition:all var(--transition-fast);white-space:nowrap}.custom-button:hover{background-color:var(--accent-primary-hover);transform:translateY(-1px)}.custom-button:active{transform:translateY(0)}.custom-button:disabled{background-color:var(--bg-tertiary);color:var(--text-secondary);cursor:not-allowed;transform:none}.icon-button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;background-color:transparent;border:1px solid var(--border-color-light);border-radius:var(--radius-md);color:var(--text-primary);cursor:pointer;transition:all var(--transition-fast)}.icon-button:hover{background-color:var(--bg-hover);border-color:var(--accent-primary);color:var(--accent-primary)}.github-button{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-2) var(--space-3);background-color:#24292e;border:1px solid var(--border-color-light);border-radius:var(--radius-md);color:var(--text-primary);font-size:var(--font-size-md);cursor:pointer;transition:all var(--transition-fast)}.github-button:hover{background-color:#2f363d;border-color:var(--accent-primary)}.toast-notification{position:fixed;bottom:var(--space-5);right:var(--space-5);display:flex;align-items:center;gap:var(--space-2);padding:var(--space-3) var(--space-4);background-color:var(--accent-success);color:#fff;font-size:var(--font-size-base);font-weight:var(--font-weight-medium);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);z-index:var(--z-toast);animation:slideInRight var(--transition-normal) ease}.toast-notification.error{background-color:var(--accent-error)}.toast-notification .icon{display:flex;flex-shrink:0}@keyframes slideInRight{0%{transform:translate(100%);opacity:0}to{transform:translate(0);opacity:1}}.mobile-overlay{display:none;position:fixed;top:0;right:0;bottom:0;left:0;background-color:#0009;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);z-index:var(--z-overlay);opacity:0;pointer-events:none;transition:opacity var(--transition-normal)}.mobile-overlay.active{opacity:1;pointer-events:auto}.mobile-toolbar{display:none;position:fixed;bottom:0;left:0;right:0;height:var(--mobile-toolbar-height);background:linear-gradient(180deg,var(--bg-secondary) 0%,var(--bg-primary) 100%);border-top:1px solid var(--border-color-light);z-index:var(--z-toolbar);padding:0 var(--space-2);align-items:center;justify-content:space-around;box-shadow:0 -4px 20px #0006}.mobile-toolbar-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:var(--space-2) var(--space-3);min-width:56px;background:transparent;border:none;border-radius:var(--radius-lg);color:var(--text-secondary);font-family:var(--font-mono);font-size:var(--font-size-xs);cursor:pointer;transition:all var(--transition-fast);-webkit-tap-highlight-color:transparent}.mobile-toolbar-btn svg{width:22px;height:22px}.mobile-toolbar-btn:hover,.mobile-toolbar-btn:active{background-color:var(--bg-hover);color:var(--text-primary)}.mobile-toolbar-btn.active{background-color:#007acc26;color:var(--accent-primary)}.more-menu{position:fixed;bottom:calc(var(--mobile-toolbar-height) + var(--space-3));right:var(--space-3);min-width:180px;background-color:var(--bg-tertiary);border:1px solid var(--border-color-light);border-radius:var(--radius-xl);box-shadow:var(--shadow-lg);z-index:var(--z-modal);overflow:hidden;opacity:0;transform:translateY(10px) scale(.95);pointer-events:none;transition:all var(--transition-fast)}.more-menu.active{opacity:1;transform:translateY(0) scale(1);pointer-events:auto}.more-menu-item{display:flex;align-items:center;gap:var(--space-3);width:100%;padding:var(--space-3) var(--space-4);background:transparent;border:none;color:var(--text-primary);font-family:var(--font-mono);font-size:var(--font-size-md);text-align:left;cursor:pointer;transition:background-color var(--transition-fast)}.more-menu-item:hover,.more-menu-item:active{background-color:var(--bg-active)}.more-menu-item svg{width:18px;height:18px;flex-shrink:0}.more-menu-divider{height:1px;background-color:var(--border-color-light);margin:var(--space-1) 0}@keyframes pulse{0%,to{opacity:.4}50%{opacity:.8}}@keyframes slideIn{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@media(min-width:769px)and (max-width:1024px){:root{--sidebar-width: 220px;--terminal-height: 160px}.subterm-topbar{padding:0 var(--space-3)}}@media(min-width:1280px){:root{--sidebar-width: 280px;--terminal-height: 220px}}@media(max-width:768px){:root{--topbar-height: 48px}.mobile-toolbar{display:flex}.mobile-overlay{display:block}.mobile-only{display:flex!important}.desktop-only{display:none!important}.playground{padding-bottom:var(--mobile-toolbar-height)}.subterm-topbar{padding:0 var(--space-3);height:var(--topbar-height)}.subterm-topbar .logo-text{font-size:var(--font-size-base)}.container{flex-direction:column}.files{position:fixed;left:0;top:var(--topbar-height);bottom:var(--mobile-toolbar-height);width:85vw;max-width:320px;z-index:var(--z-panel);transform:translate(-100%);box-shadow:var(--shadow-panel)}.files.mobile-visible{transform:translate(0)}.files .panel-close-btn{display:flex}.editor{flex:1;width:100%;height:100%}.terminal{position:fixed;left:0;right:0;bottom:var(--mobile-toolbar-height);height:0;max-height:0;padding:0;opacity:0;z-index:var(--z-panel);overflow:hidden;box-shadow:0 -4px 20px #0006;transition:all var(--transition-normal)}.terminal.mobile-visible{height:45vh;max-height:45vh;padding:var(--space-3);opacity:1;overflow:auto}.terminal-mobile-header{display:flex!important}.toast-notification{bottom:calc(var(--mobile-toolbar-height) + var(--space-3));right:var(--space-3);left:var(--space-3);max-width:none}.file-tree-item{padding:var(--space-3) var(--space-4);min-height:44px}button,.clickable{min-height:44px;min-width:44px}}@media(max-width:480px){.files{width:100vw;max-width:100vw}.mobile-toolbar-btn{padding:var(--space-2);min-width:48px;font-size:9px}.mobile-toolbar-btn svg{width:20px;height:20px}.more-menu{right:var(--space-2);left:var(--space-2);min-width:auto}.terminal.mobile-visible{height:50vh;max-height:50vh}}@media(max-width:768px)and (orientation:landscape){.terminal.mobile-visible{height:55vh;max-height:55vh}.files{bottom:var(--mobile-toolbar-height)}}[data-theme=light]{--bg-primary: #FFFFFF;--bg-secondary: #F5F5F5;--bg-tertiary: #EBEBEB;--bg-elevated: #E0E0E0;--bg-hover: #D5D5D5;--bg-active: #BBDEFB;--text-primary: #1E1E1E;--text-secondary: #666666;--text-muted: #999999;--border-color: #E0E0E0;--border-color-light: #CCCCCC;--shadow-sm: 0 2px 8px rgba(0, 0, 0, .08);--shadow-md: 0 4px 16px rgba(0, 0, 0, .12);--shadow-lg: 0 8px 32px rgba(0, 0, 0, .16)}
