/**
 * 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}*{box-sizing:border-box}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,sans-serif;background-color:#111827;color:#f3f4f6}.app{display:flex;flex-direction:column;height:100vh;padding:16px;gap:12px}.app-header{display:flex;align-items:center;gap:12px}.app-logo{height:48px;width:auto}.connection-bar,.toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.input-field,.device-selector{padding:8px 12px;border:1px solid #374151;border-radius:6px;background-color:#1f2937;color:#f3f4f6;font-size:14px;outline:none}.input-field{flex:1;min-width:200px}.logcat-filter{flex:0 0 auto;min-width:180px;max-width:240px}.logcat-since{display:flex;align-items:center;gap:6px;flex:0 0 auto;color:#9ca3af;font-size:13px;white-space:nowrap}.logcat-since-input{color-scheme:dark;padding:8px 10px}.device-select{position:relative;flex:1;min-width:220px}.device-select-trigger{width:100%;padding:8px 12px;border:1px solid #374151;border-radius:6px;background-color:#1f2937;color:#f3f4f6;font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:8px}.device-select-trigger:disabled{opacity:.6;cursor:not-allowed}.device-select-placeholder{color:#9ca3af}.device-select-arrow{font-size:10px;color:#9ca3af;flex-shrink:0}.device-trigger-row{display:inline-flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0}.device-select-dropdown{position:absolute;top:calc(100% + 4px);left:0;right:0;background-color:#1f2937;border:1px solid #374151;border-radius:6px;box-shadow:0 10px 15px -3px #00000080;z-index:100;padding:6px;max-height:320px;display:flex;flex-direction:column}.device-select-search{padding:8px 10px;border:1px solid #374151;border-radius:4px;background-color:#111827;color:#f3f4f6;font-size:14px;outline:none;margin-bottom:6px}.device-select-search:focus{border-color:#60a5fa}.device-select-list{list-style:none;margin:0;padding:0;overflow-y:auto;max-height:220px}.device-select-option{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 10px;border-radius:4px;cursor:pointer;font-size:14px}.device-select-option:hover{background-color:#374151}.device-select-option.selected{background-color:#2563eb}.device-select-empty{padding:10px;font-size:13px;color:#9ca3af;text-align:center}.device-option-main{font-size:14px}.device-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;padding:2px 6px;border-radius:4px;background-color:#111827;border:1px solid #374151;font-size:12px;color:#d1d5db;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.device-chip-label{color:#9ca3af;font-weight:500;font-size:11px;text-transform:uppercase}.input-field:focus,.device-selector:focus{border-color:#60a5fa}.input-field:disabled,.device-selector:disabled{opacity:.6}.btn{padding:8px 16px;border:none;border-radius:6px;font-size:14px;cursor:pointer;transition:background-color .2s;display:inline-flex;align-items:center;gap:6px}.btn-icon{width:16px;height:16px;flex-shrink:0}.btn:disabled{opacity:.5;cursor:not-allowed}.btn-primary{background-color:#2563eb;color:#fff}.btn-primary:hover:not(:disabled){background-color:#1d4ed8}.btn-secondary{background-color:#4b5563;color:#fff}.btn-secondary:hover:not(:disabled){background-color:#374151}.btn-warning{background-color:#d97706;color:#fff}.btn-warning:hover:not(:disabled){background-color:#b45309}.btn-danger{background-color:#dc2626;color:#fff}.btn-danger:hover:not(:disabled){background-color:#b91c1c}.error-banner{background-color:#7f1d1d;color:#fecaca;padding:10px 12px;border-radius:6px;font-size:14px}.device-info-panel{background-color:#1f2937;border:1px solid #374151;border-radius:6px;padding:10px 12px}.device-info-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px 16px}.device-info-item{display:flex;flex-direction:column;gap:2px}.device-info-label{font-size:11px;color:#9ca3af;text-transform:uppercase;font-weight:500}.device-info-value{font-size:13px;color:#f3f4f6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.status-on{color:#4ade80}.status-off{color:#f87171}.tab-bar{display:flex;gap:4px;align-items:center;flex-wrap:wrap}.tab{display:flex;align-items:center;gap:6px;padding:6px 12px;background-color:#1f2937;border:1px solid #374151;border-radius:6px 6px 0 0;cursor:pointer;font-size:13px;color:#9ca3af;max-width:240px}.tab:hover{background-color:#374151}.tab.active{background-color:#111827;color:#f3f4f6;border-bottom-color:#111827}.tab-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tab-close{border:none;background:transparent;color:#9ca3af;cursor:pointer;font-size:16px;line-height:1;padding:0 2px}.tab-close:hover:not(:disabled){color:#f87171}.tab-close:disabled{opacity:.3;cursor:not-allowed}.tab-add{padding:6px 12px;background-color:#2563eb;border:none;color:#fff;border-radius:6px;cursor:pointer;font-size:16px;line-height:1}.tab-add:hover{background-color:#1d4ed8}.terminal-wrapper{flex:1;min-height:0;border:1px solid #374151;border-radius:6px;overflow:hidden;position:relative}.terminal-session-pane{width:100%;height:100%}.terminal-wrapper .xterm{padding:8px 12px}.terminal-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background-color:#0c0c0cb3;z-index:10}.terminal-overlay-text{color:#9ca3af;font-size:14px;padding:12px 20px;border:1px dashed #374151;border-radius:6px}.screenshot-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000000d9;display:flex;align-items:center;justify-content:center;z-index:1000;padding:24px}.screenshot-panel{background-color:#1f2937;border:1px solid #374151;border-radius:8px;max-width:90vw;max-height:90vh;display:flex;flex-direction:column;overflow:hidden}.screenshot-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px;border-bottom:1px solid #374151;font-size:14px;font-weight:500}.screenshot-image{max-width:100%;max-height:calc(90vh - 60px);object-fit:contain;background-color:#111827}.btn-small{padding:4px 10px;font-size:12px}.connection-bar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:10px 12px;background-color:#1f2937;border:1px solid #374151;border-radius:8px}.login-title{font-size:16px;font-weight:600;color:#f3f4f6}.field-label{font-size:11px;font-weight:600;color:#9ca3af;text-transform:uppercase;letter-spacing:.03em}.btn-outline{background-color:transparent;color:#93c5fd;border:1px solid #374151;padding:6px 12px;font-size:13px}.btn-outline:hover:not(:disabled){background-color:#374151;border-color:#60a5fa}.btn-full{width:100%;padding:12px 16px;font-weight:600;white-space:nowrap}.twofa-badge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;background-color:#052e16;color:#4ade80;border:1px solid #166534;font-size:12px;font-weight:600;white-space:nowrap}.otp-input{display:flex;gap:8px;justify-content:space-between}.otp-box{width:100%;max-width:40px;height:38px;padding:0;text-align:center;font-size:16px;font-weight:600;color:#f3f4f6;background-color:#111827;border:1px solid #374151;border-radius:6px;outline:none;transition:border-color .15s,box-shadow .15s}.otp-box:focus{border-color:#60a5fa;box-shadow:0 0 0 2px #60a5fa40}.otp-box:disabled{opacity:.5}.twofa-qr{display:flex;flex-direction:column;gap:12px;padding:14px;background-color:#111827;border:1px solid #374151;border-radius:8px;margin-top:4px}.twofa-qr-head{display:flex;gap:16px;align-items:flex-start;flex-wrap:wrap}.twofa-qr-image{width:150px;height:150px;image-rendering:pixelated;background-color:#fff;border-radius:8px;flex-shrink:0}.twofa-qr-steps{display:flex;flex-direction:column;gap:6px;flex:1;min-width:180px}.twofa-qr-title{font-size:14px;font-weight:600;color:#f3f4f6}.twofa-qr-steps ol{margin:0;padding-left:18px;font-size:13px;color:#d1d5db;line-height:1.6}.twofa-secret{font-family:Menlo,Monaco,Courier New,monospace;font-size:12px;color:#9ca3af;word-break:break-all;background-color:#1f2937;padding:8px;border-radius:6px}.twofa-confirm{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.twofa-message{font-size:13px;padding:8px 10px;border-radius:6px;line-height:1.4}.twofa-message-info{color:#93c5fd;background-color:#172554;border:1px solid #1e3a8a}.twofa-message-success{color:#4ade80;background-color:#052e16;border:1px solid #166534}.twofa-message-error{color:#f87171;background-color:#450a0a;border:1px solid #7f1d1d}
