/**
 * 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{color-scheme:light;font-family:IBM Plex Sans,Segoe UI,sans-serif;background:#f1f5f9;color:#0f172a}html,body,#root{height:100%}*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at 10% 0%,#dbeafe,#f8fafc 35%,#f1f5f9);overflow:hidden}button,input{font:inherit}.auth-shell{min-height:100vh;display:grid;place-items:center;padding:1rem}.auth-card{width:min(420px,100%);background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:1rem;display:grid;gap:.75rem}.auth-card h1{margin:0}.auth-card label{display:grid;gap:.25rem;font-size:.95rem}.auth-card input,.chat-input input,.file-list input{border:1px solid #cbd5e1;border-radius:8px;padding:.5rem .6rem}.auth-card button,.panel-header button,.chat-input button,header button{border:0;border-radius:8px;background:#0ea5e9;color:#fff;padding:.5rem .7rem;cursor:pointer}.auth-card .link{background:transparent;color:#0f172a;border:1px solid #e2e8f0}.error{color:#b91c1c;font-size:.9rem}.loading{min-height:100vh;display:grid;place-items:center}.app-shell{height:100vh;min-height:0;display:flex;flex-direction:column;gap:.25rem}header{display:flex;justify-content:space-between;align-items:center;padding:.5rem .75rem;border-bottom:1px solid #e2e8f0;background:#fff}header h1{margin:0;font-size:1.2rem}header p{margin:0;color:#475569;font-size:.9rem}.header-actions{display:flex;align-items:center;gap:.6rem}.progress{font-size:.9rem;color:#334155}.banner{margin:0 .75rem;background:#dcfce7;color:#166534;border:1px solid #bbf7d0;padding:.25rem .5rem;border-radius:8px}main{flex:1;min-height:0;display:grid;gap:.4rem;grid-template-columns:28fr 10px 44fr 10px 28fr;padding:0 .4rem .4rem;overflow:hidden}.left-col,.center-col,.right-col{min-height:0;display:grid;gap:.35rem}.left-col{grid-template-rows:65fr 10px 35fr}.center-col{grid-template-rows:68fr 10px 32fr}.right-col{grid-template-rows:1fr}.resize-handle{border-radius:8px;background:#d7dee7;border:1px solid #c8d1dc;opacity:.9;position:relative}.resize-handle.vertical{cursor:col-resize}.resize-handle.horizontal{cursor:row-resize;min-height:10px;touch-action:none}.resize-handle:hover{background:#c0ccda}.resize-handle:after{content:"";position:absolute;inset:50% auto auto 50%;width:32px;height:2px;background:#7f8fa3;transform:translate(-50%,-50%);border-radius:99px}.resize-handle.vertical:after{width:2px;height:32px}body.resizing{-webkit-user-select:none;user-select:none}.panel{background:#fff;border:1px solid #dbe2ea;border-radius:12px;padding:.45rem;min-height:0;overflow:hidden;display:flex;flex-direction:column}.panel-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.35rem}.panel-header h2{margin:0;font-size:1rem}.course-panel .session-tabs{display:flex;gap:.4rem;margin-bottom:.35rem}.session-tabs button{border:1px solid #cbd5e1;background:#f8fafc;border-radius:999px;padding:.3rem .6rem}.session-tabs .active{background:#e0f2fe;border-color:#7dd3fc}.course-panel h3{margin:.1rem 0 .25rem}.markdown{overflow:auto;font-size:.9rem;border:1px solid #e2e8f0;border-radius:8px;padding:.35rem;flex:1;min-height:90px}.steps{margin-top:.3rem;display:grid;gap:.25rem}.steps label{display:flex;gap:.4rem;align-items:flex-start;font-size:.9rem}.editor-layout{display:grid;grid-template-columns:210px 1fr;gap:.35rem;min-height:0;flex:1}.file-list{display:flex;flex-direction:column;min-height:0;gap:.25rem}.file-list button{text-align:left;border:1px solid #e2e8f0;border-radius:8px;background:#f8fafc;padding:.38rem .45rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-list .active{background:#e0f2fe}.editor-wrap{min-height:0;border:1px solid #dbe2ea;border-radius:8px;overflow:hidden}.empty{height:100%;display:grid;place-items:center;color:#64748b}.terminal-host{flex:1;min-height:0;border-radius:8px;overflow:hidden;background:#0f172a;padding:.25rem}.chat-panel{min-height:0}.chat-log{flex:1;overflow:auto;display:grid;gap:.35rem}.bubble{border:1px solid #e2e8f0;border-radius:10px;padding:.35rem .45rem;font-size:.92rem}.bubble.user{background:#f0f9ff}.bubble strong{display:block;margin-bottom:.15rem}.bubble p{margin:0;white-space:pre-wrap}.chat-input{margin-top:.35rem;display:grid;grid-template-columns:1fr auto;gap:.3rem}@media (max-width: 1200px){main{grid-template-columns:1fr}.center-col{grid-template-rows:520px 260px}.editor-layout{grid-template-columns:170px 1fr}.resize-handle{display:none}}.deploy-panel .panel-header{font-weight:600}.deploy-panel .badge{font-size:.7rem;text-transform:uppercase;letter-spacing:.03em;background:#eef2f7;color:#475569;border-radius:999px;padding:.1rem .5rem}.badge-ready{background:#dcfce7;color:#166534}.badge-pending{background:#fef9c3;color:#713f12}.badge-error{background:#fee2e2;color:#991b1b}.deploy-body{display:flex;flex-direction:column;gap:.5rem;flex:1;min-height:0;overflow-y:auto}.slot-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:.55rem .65rem}.slot-title{font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:#64748b;margin-bottom:.4rem}.slot-fields{display:grid;gap:.35rem}.slot-field{display:flex;align-items:flex-start;gap:.5rem;font-size:.82rem}.slot-icon{font-size:1rem;line-height:1.2}.slot-sub{color:#64748b;font-size:.75rem;font-family:IBM Plex Mono,monospace}.slot-pending{font-size:.82rem;color:#64748b;margin:0}.deploy-btn{background:#2563eb;color:#fff;border:none;border-radius:8px;padding:.55rem .9rem;font-weight:600;font-size:.9rem;cursor:pointer;transition:background .15s}.deploy-btn:hover{background:#1d4ed8}.deploy-btn:disabled{background:#94a3b8;cursor:default}.pipeline{display:flex;align-items:center;gap:.1rem;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;padding:.5rem .55rem;overflow-x:auto}.pipe-step{display:flex;flex-direction:column;align-items:center;gap:.15rem;position:relative;opacity:.35;transition:opacity .2s;min-width:52px}.pipe-step.done,.pipe-step.active{opacity:1}.pipe-icon{font-size:1.15rem;line-height:1}.pipe-step.active .pipe-icon{animation:pulse-icon .9s ease-in-out infinite}@keyframes pulse-icon{0%,to{transform:scale(1)}50%{transform:scale(1.18)}}.pipe-label{font-size:.65rem;color:#475569;text-align:center;line-height:1.2}.pipe-arrow{font-size:.75rem;color:#cbd5e1;margin:0 .1rem .9rem;transition:color .2s;align-self:flex-end}.pipe-arrow.done{color:#22c55e}.deploy-status-row{display:flex;align-items:center;gap:.5rem;font-size:.82rem;color:#475569}.spinner{display:inline-block;width:14px;height:14px;border:2px solid #cbd5e1;border-top-color:#2563eb;border-radius:50%;animation:spin .7s linear infinite;flex-shrink:0}@keyframes spin{to{transform:rotate(360deg)}}.deploy-success{background:#f0fdf4;border:1px solid #86efac;border-radius:10px;padding:.6rem .7rem;display:flex;flex-direction:column;gap:.45rem}.deploy-success-header{font-weight:600;font-size:.85rem;color:#166534}.url-anatomy{display:flex;flex-direction:column;gap:.3rem}.url-full{font-size:.75rem;word-break:break-all;color:#0f172a;background:#e2f5e9;padding:.2rem .35rem;border-radius:5px}.url-parts{display:flex;flex-wrap:wrap;gap:.25rem}.url-part{display:flex;flex-direction:column;align-items:center;gap:.1rem}.url-value{font-family:IBM Plex Mono,monospace;font-size:.68rem;padding:.15rem .3rem;border-radius:4px;font-weight:600}.url-label{font-size:.6rem;color:#64748b}.url-part.scheme .url-value{background:#dbeafe;color:#1d4ed8}.url-part.host .url-value{background:#fef9c3;color:#713f12}.url-part.suffix .url-value{background:#e0e7ff;color:#3730a3}.url-part.port .url-value{background:#fce7f3;color:#9d174d}.deploy-actions{display:flex;gap:.4rem;flex-wrap:wrap}.deploy-open{background:#16a34a;color:#fff;border:none;border-radius:7px;padding:.38rem .65rem;font-size:.82rem;font-weight:600;text-decoration:none;cursor:pointer}.deploy-copy,.deploy-again{background:#fff;border:1px solid #d1d5db;border-radius:7px;padding:.38rem .65rem;font-size:.82rem;cursor:pointer;color:#374151}.deploy-copy:hover,.deploy-again:hover{background:#f9fafb}.deploy-again:disabled{opacity:.5;cursor:default}.deploy-hint{font-size:.75rem;color:#4b7c5f;margin:0}.deploy-error-box{background:#fff1f2;border:1px solid #fecdd3;border-radius:10px;padding:.5rem .65rem;font-size:.82rem;color:#9f1239;display:flex;align-items:center;justify-content:space-between;gap:.5rem}.deploy-retry{background:#e11d48;color:#fff;border:none;border-radius:6px;padding:.3rem .6rem;font-size:.8rem;cursor:pointer;white-space:nowrap}.deploy-log-details{font-size:.78rem}.deploy-log-details summary{cursor:pointer;color:#64748b;-webkit-user-select:none;user-select:none;padding:.1rem 0}.deploy-log{background:#0f172a;color:#cbd5e1;font-size:.72rem;line-height:1.35;border-radius:8px;padding:.5rem;max-height:180px;overflow:auto;white-space:pre-wrap;margin:.25rem 0 0}.log-step{color:#7dd3fc}.log-log{color:#94a3b8}.log-err{color:#f87171}
