/**
 * 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,.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.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-dark: #0f111a;--bg-panel: #1a1d27;--bg-panel-hover: #222633;--text-main: #e2e8f0;--text-muted: #94a3b8;--accent-primary: #6366f1;--accent-secondary: #8b5cf6;--success: #10b981;--error: #ef4444;--border-color: rgba(255, 255, 255, .08);--glass-bg: rgba(26, 29, 39, .7);--glass-border: rgba(255, 255, 255, .1);--font-family: "Inter", sans-serif;--editor-font: "JetBrains Mono", "Fira Code", monospace;--brand-gradient-start: #ffffff;--brand-gradient-end: var(--text-muted)}*{box-sizing:border-box;margin:0;padding:0}body{font-family:var(--font-family);background-color:var(--bg-dark);color:var(--text-main);background-image:radial-gradient(circle at 10% 20%,rgba(99,102,241,.08) 0%,transparent 40%),radial-gradient(circle at 90% 80%,rgba(139,92,246,.08) 0%,transparent 40%);background-attachment:fixed;display:flex;flex-direction:column;height:100vh;overflow:hidden}.app-container{display:flex;flex-direction:column;height:100vh;width:100vw}.navbar{display:flex;justify-content:space-between;align-items:center;padding:1rem 2rem;background:var(--glass-bg);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-bottom:1px solid var(--border-color);z-index:10;user-select:none;-webkit-user-select:none}.brand{display:flex;align-items:center;gap:12px}.brand-icon{width:32px;height:32px;background:linear-gradient(135deg,var(--accent-primary),var(--accent-secondary));border-radius:8px;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;box-shadow:0 0 15px #6366f166}.brand h1{font-size:1.25rem;font-weight:700;letter-spacing:.5px;background:linear-gradient(to right,var(--brand-gradient-start),var(--brand-gradient-end));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.controls{display:flex;align-items:center;gap:1rem}.custom-dropdown{position:relative;min-width:200px}.dropdown-selected{background:var(--bg-panel);color:var(--text-main);border:1px solid var(--border-color);padding:.5rem 1rem;border-radius:6px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;transition:all .2s ease;font-size:.9rem;font-weight:500;-webkit-user-select:none;user-select:none}.dropdown-selected:hover{background:var(--bg-panel-hover);border-color:var(--accent-primary)}.dropdown-arrow{font-size:.7rem;color:var(--text-muted);pointer-events:none}.dropdown-menu{position:absolute;top:110%;left:0;width:100%;background:var(--bg-panel);border:1px solid var(--border-color);border-radius:8px;overflow:hidden;z-index:100;box-shadow:0 8px 30px #0006;display:flex;flex-direction:column}.dropdown-item{display:flex;align-items:center;gap:12px;padding:.65rem 1rem;cursor:pointer;transition:all .2s;font-size:.9rem;color:var(--text-main)}.dropdown-item:hover,.dropdown-item.active{background:#6366f126;color:var(--accent-primary)}.dropdown-logo{width:20px;height:20px;object-fit:contain}body[data-theme=light]{--bg-dark: #f8fafc;--bg-panel: #ffffff;--bg-panel-hover: #f1f5f9;--text-main: #0f172a;--text-muted: #64748b;--border-color: rgba(0, 0, 0, .12);--glass-bg: rgba(255, 255, 255, .85);--glass-border: rgba(0, 0, 0, .15);--brand-gradient-start: #0f172a;--brand-gradient-end: var(--accent-primary)}.theme-toggle-btn{background:transparent;border:1px solid var(--border-color);color:var(--text-main);border-radius:8px;width:36px;height:36px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s;font-size:1.1rem;user-select:none;-webkit-user-select:none}.theme-toggle-btn:hover{background:var(--bg-panel-hover);border-color:var(--accent-primary)}.run-btn{background:linear-gradient(135deg,var(--accent-primary),var(--accent-secondary));color:#fff;border:none;padding:.5rem 1.5rem;border-radius:6px;font-family:var(--font-family);font-weight:600;font-size:.95rem;cursor:pointer;display:flex;align-items:center;gap:8px;transition:all .3s ease;box-shadow:0 4px 14px #6366f14d;user-select:none;-webkit-user-select:none}.run-btn:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 6px 20px #6366f166}.run-btn:active:not(:disabled){transform:translateY(1px)}.run-btn:disabled{opacity:.7;cursor:not-allowed;box-shadow:none}.spinner{width:14px;height:14px;border:2px solid rgba(255,255,255,.3);border-radius:50%;border-top-color:#fff;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.main-content{display:flex;flex:1;overflow:hidden;padding:1rem;gap:1rem}.pane{background:var(--bg-panel);border:1px solid var(--border-color);border-radius:12px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 8px 32px #0003;transition:border-color .3s ease;min-height:0;min-width:0}.pane:hover{border-color:#ffffff26}.pane-header{padding:.75rem 1rem;background:#0003;border-bottom:1px solid var(--border-color);font-size:.85rem;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;display:flex;align-items:center;gap:8px;user-select:none;-webkit-user-select:none}.pane-header-icon{width:8px;height:8px;border-radius:50%;background:var(--text-muted)}.pane-header.output-header .pane-header-icon{background:var(--accent-secondary)}.editor-pane{flex:5;min-height:0;min-width:0}.editor-container{flex:1;position:relative}.side-pane{flex:3;display:flex;flex-direction:column;gap:1rem;min-height:0;min-width:0}.io-pane{flex:1;display:flex;flex-direction:column}.custom-textarea{flex:1;background:transparent;border:none;color:var(--text-main);padding:1rem;font-family:var(--editor-font);font-size:.9rem;resize:none;outline:none}.custom-textarea::placeholder{color:#fff3}.output-container{flex:1;padding:1rem;font-family:var(--editor-font);font-size:.9rem;overflow-y:auto;white-space:pre-wrap;word-break:break-word}.output-success{color:var(--text-main)}.output-error{color:var(--error)}.output-empty{color:#fff3;font-style:italic;display:flex;height:100%;align-items:center;justify-content:center}@media (max-width: 900px){body{overflow:auto}.main-content{flex-direction:column;overflow:visible}.editor-pane{flex:none;height:55vh;min-height:400px}.side-pane{flex:none;height:45vh;min-height:300px;gap:1rem}}@media (max-width: 600px){.navbar{flex-direction:column;padding:.75rem 1rem;gap:12px}.controls{width:100%;justify-content:space-between}.custom-dropdown{min-width:140px}.dropdown-selected{padding:.4rem .6rem;font-size:.85rem}.run-btn{padding:.4rem 1rem;font-size:.85rem}}.web-pane-container{display:flex;flex-direction:row;height:100%;width:100%}.web-pane{display:flex;flex-direction:column;transition:all .3s cubic-bezier(.4,0,.2,1);border-right:2px solid var(--border-color);overflow:hidden;min-width:0;min-height:0}.web-pane:last-child{border-right:none}.web-pane.active{flex:10}.web-pane.inactive{flex:0;min-width:120px}.web-pane.default{flex:1}@media (max-width: 768px){.web-pane-container{flex-direction:column}.web-pane{border-right:none;border-bottom:2px solid var(--border-color)}.web-pane:last-child{border-bottom:none}.web-pane.inactive{min-width:auto;min-height:48px}}.clear-output-btn{background:var(--bg-panel-hover);color:var(--text-muted);border:1px solid var(--border-color);border-radius:6px;padding:4px 12px;font-size:.75rem;font-family:var(--font-family);cursor:pointer;transition:all .2s ease;margin-left:auto;font-weight:600;user-select:none;-webkit-user-select:none}.clear-output-btn:hover{background:#ef44441a;color:var(--error);border-color:#ef44444d}
