/**
 * 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}.page{--bg-a: #f1f6fb;--bg-b: #d9e8f5;--panel-bg: rgba(255, 255, 255, .95);--border: #c5d8ea;--soft-border: #d8e5f2;--accent: #2d6f98;--accent-strong: #1f5576;--text: #12263a;--muted: #4f6479;--control-height: 40px;height:100vh;margin:0;padding:12px;background:radial-gradient(circle at 15% 0%,rgba(45,111,152,.12),transparent 44%),linear-gradient(165deg,var(--bg-a) 0%,var(--bg-b) 50%,#f8fbff 100%);font-family:Segoe UI,Trebuchet MS,sans-serif;font-size:15px;line-height:1.4;color:var(--text);overflow:hidden}.panel{width:min(80vw,1820px);margin:0 auto;background:var(--panel-bg);border:1px solid var(--border);border-radius:16px;padding:16px;box-shadow:0 10px 30px #23466e24}.auth-panel{max-width:420px;margin-top:clamp(24px,14vh,120px)}.dashboard-panel{height:calc(100vh - 24px);display:flex;flex-direction:column;min-height:0}.toolbar{display:flex;justify-content:space-between;gap:14px;align-items:center;position:sticky;top:0;z-index:20;background:var(--panel-bg);padding:2px 0 10px;border-bottom:1px solid var(--soft-border)}.toolbar p{margin:4px 0 0;color:var(--muted);font-size:.9rem}.section-switcher{position:sticky;top:57px;z-index:18;display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:10px 0;border-bottom:1px solid var(--soft-border);background:var(--panel-bg)}.section-switch-btn{min-height:84px;border-radius:12px;padding:10px 16px;background:#2f6f9a;border:1px solid #2f6f9a;color:#fff;font-size:1.08rem;font-weight:700}.section-switch-btn.secondary{background:#556f86;border-color:#556f86}.section-switch-btn.active{box-shadow:0 0 0 3px #2d6f9833}.section-path{color:var(--muted);margin:0;font-size:.88rem}.view-block{margin-top:12px;flex:1;min-height:0;display:flex;flex-direction:column;gap:12px;overflow:hidden}.home-block{justify-content:center}.home-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px;max-width:760px}.home-action-btn{min-height:84px;font-size:1.05rem;font-weight:700;border-radius:10px}.menu-block,.testing-block,.testing-details-block{min-height:0}.row-between{display:flex;align-items:center;justify-content:space-between;gap:10px}.form{display:grid;gap:10px}.auth-panel .form,.create-block .form{max-width:420px}.host-list-scroll{flex:1;min-height:0;overflow:auto;border:1px solid var(--soft-border);border-radius:12px;background:#fcfdff;padding:10px;display:grid;gap:8px;align-content:start}label{display:grid;gap:5px;font-size:.9rem;color:var(--text)}.fleet-filters{display:grid;grid-template-columns:1.4fr 1fr;gap:10px}.check-row{display:flex;align-items:center;gap:8px}.check-row input{margin:0}input,select,textarea{border:1px solid #b7cbdd;border-radius:10px;padding:9px 11px;min-height:var(--control-height);font-size:.92rem;background:#fff;color:var(--text);transition:border-color .15s ease}input:focus,select:focus,textarea:focus{outline:none;border-color:#77a3c4;box-shadow:0 0 0 2px #2d6f981f}button{border:none;border-radius:10px;padding:9px 14px;min-height:var(--control-height);font-size:.9rem;font-weight:600;background:var(--accent);color:#fff;cursor:pointer;transition:filter .15s ease}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,.testing-row:focus-visible,.test-chip:focus-visible{outline:3px solid rgba(45,111,152,.25);outline-offset:2px}button:hover:not(:disabled){filter:brightness(.96)}button.secondary{background:#4d6478}button.danger{background:#b91c1c}button:disabled{opacity:.7;cursor:not-allowed}.host-row{width:100%;margin-top:0;background:#f8fbff;color:var(--text);border:1px solid #d6e5f4;display:flex;justify-content:space-between;align-items:center;padding:12px;text-align:left}.host-row:hover{border-color:#89aecb}.host-name{font-weight:600;text-transform:uppercase;font-size:.88rem}.status-wrap{display:inline-flex;align-items:center;gap:7px;font-size:.86rem}.status-line{display:flex;align-items:center;gap:7px;font-size:.92rem}.head-actions{display:inline-flex;gap:8px;flex-wrap:wrap}.tab-switcher{display:flex;gap:8px;flex-wrap:wrap}.details-block>.tab-switcher{margin-top:4px}.tab-btn{background:#6b8093;padding-inline:14px;border-radius:999px}.tab-btn.active{background:var(--accent-strong)}.status-dot{width:10px;height:10px;border-radius:50%;display:inline-block}.status-on{background:#16a34a}.status-off{background:#dc2626}.status-unknown{background:#94a3b8}.detail-content{flex:1;min-height:0;overflow:auto;display:grid;gap:12px;align-content:start;padding-right:3px}.config-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:0;min-height:0}.config-grid>.config-box{display:flex;flex-direction:column;min-height:0}.config-grid .form{overflow:auto;padding-right:4px}.health-box{margin-top:0}.health-summary-grid{margin-top:10px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.health-card{border:1px solid var(--soft-border);border-radius:10px;background:#fff;padding:10px}.health-card h4,.health-runs h4{margin:0 0 6px}.health-status-line{display:inline-flex;align-items:center;gap:6px}.health-runs{margin-top:10px}.health-runs-list{margin-top:8px;display:grid;gap:8px;max-height:min(46vh,420px);overflow-y:auto;padding-right:4px}.health-run-row{border:1px solid var(--soft-border);border-radius:10px;background:#fff;padding:10px;display:grid;grid-template-columns:1.1fr 1fr 1fr 1.6fr;gap:10px;font-size:.88rem}.health-run-main p{margin:2px 0}.calibration-box,.diagnostics-config-box{margin-top:0}.diagnostics-tests-grid{margin-top:10px;display:grid;grid-template-columns:1fr 1fr;gap:10px}.diagnostics-tests-col{border:1px solid var(--soft-border);border-radius:10px;background:#fff;padding:10px;max-height:320px;overflow:auto}.diagnostics-tests-col h4{margin:0 0 6px}.config-box{border:1px solid var(--soft-border);border-radius:12px;padding:12px;background:#f9fcff;overflow:hidden}.raw-text{width:100%;min-height:170px;height:clamp(170px,24vh,280px);margin-top:10px;font-family:monospace;font-size:.88rem;resize:vertical}.raw-text-lg{min-height:230px;height:clamp(230px,34vh,460px)}.import-label{font-size:.86rem;color:var(--text);cursor:pointer}.import-label input{display:none}.scripts-box{margin-top:0;display:flex;flex-direction:column;min-height:0}.scripts-grid{margin-top:0;display:grid;grid-template-columns:1fr 1fr;gap:12px;min-height:0}.operations-grid{display:grid;gap:12px;min-height:0}.script-actions{margin-top:10px;display:flex;gap:8px;flex-wrap:wrap}.script-actions-wrap{flex-wrap:wrap}.compose-actions{margin-top:10px}.terminal-box{margin-top:0;display:flex;flex-direction:column;min-height:0}.terminal-container{margin-top:10px;height:clamp(230px,40vh,430px);border:1px solid #1e293b;border-radius:10px;overflow:hidden;background:#0f172a}.compose-terminal{height:clamp(160px,24vh,250px)}.script-log{margin-top:10px;height:clamp(180px,26vh,300px);overflow:auto;background:#0f172a;color:#e2e8f0;border-radius:10px;padding:10px;font-family:monospace;font-size:.84rem;white-space:pre-wrap;word-break:break-word}.testing-table-box,.testing-detail-box{margin-top:0}.testing-table-box{display:flex;flex-direction:column;flex:1;min-height:0}.testing-filters{margin-top:10px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.testing-table-scroll{margin-top:10px;flex:1;min-height:0;overflow:auto;border:1px solid var(--soft-border);border-radius:10px;background:#fff}.testing-table{width:100%;border-collapse:collapse;min-width:820px}.testing-table th,.testing-table td{border-bottom:1px solid #e2e8f0;padding:9px 10px;text-align:left;font-size:.86rem}.testing-table th{background:#f1f5f9;color:var(--text);position:sticky;top:0;z-index:1}.th-stack{display:inline-block;line-height:1.1;white-space:normal}.testing-row{cursor:pointer}.testing-row:hover{background:#eff6ff}.testing-row:focus-visible{background:#eff6ff}.testing-row-active{background:#dbeafe}.testing-cards{display:none}.testing-card{width:100%;margin-top:0;text-align:left;background:#fff;color:var(--text);border:1px solid var(--soft-border);border-radius:12px}.testing-card p{margin:4px 0;font-size:.88rem}.testing-card-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:6px}.testing-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.testing-detail-grid article{border:1px solid var(--soft-border);border-radius:10px;background:#fff;padding:10px}.testing-detail-grid p{margin:4px 0;font-size:.88rem}.testing-details-block .testing-detail-box{flex:1;min-height:0;overflow:auto;display:grid;gap:12px;align-content:start;padding-right:4px}.timeline-box{margin-top:0}.timeline-collapse{border:1px solid var(--soft-border);border-radius:10px;background:#fff;overflow:hidden}.timeline-collapse summary{padding:10px 12px;cursor:pointer;font-weight:600;font-size:.92rem;background:#f8fbff}.timeline-collapse-body{padding:8px 10px 10px}.test-chip-list{margin-top:8px;display:flex;flex-wrap:wrap;gap:8px;max-height:180px;overflow:auto}.test-chip{display:inline-flex;align-items:center;gap:8px;background:#e2e8f0;color:var(--text);border:1px solid #cbd5e1;padding:6px 10px;border-radius:999px;font-size:.82rem}.test-chip small{font-weight:700;letter-spacing:.01em}.test-chip.active{box-shadow:0 0 0 2px #2d6f9840}.test-chip.result-pass{background:#dcfce7;border-color:#86efac;color:#14532d}.test-chip.result-fail{background:#fee2e2;border-color:#fca5a5;color:#7f1d1d}.test-chip.result-unknown{background:#e2e8f0;border-color:#cbd5e1;color:#0f172a}.result-pass{color:#15803d;font-weight:700}.result-fail{color:#b91c1c;font-weight:700}.result-unknown{color:#475569;font-weight:700}.autograding-box{margin-top:10px;padding:10px;border:1px solid var(--soft-border);border-radius:10px;background:#fff}.artifact-grid{margin-top:10px;display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px}.artifact-card{border:1px solid var(--soft-border);border-radius:10px;padding:10px;background:#fff}.artifact-card p{margin:4px 0;font-size:.84rem}.artifact-image{width:100%;max-height:180px;object-fit:contain;border-radius:6px;border:1px solid var(--soft-border);background:#f8fafc}.artifact-image-link{display:block;text-decoration:none}.artifact-image-clickable{cursor:zoom-in}.artifact-audio{width:100%}.files-list{margin:0;padding-left:18px;max-height:220px;overflow:auto}.files-list li{margin:4px 0;font-size:.88rem;word-break:break-word}.danger-zone{border-color:#f2d5d5;background:#fff8f8}.danger-zone summary{cursor:pointer;font-weight:700;font-size:.92rem}.danger-zone[open]{background:#fff4f4}.danger-zone-body{margin-top:10px;display:grid;gap:8px}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:70;background:#0f172a85;display:flex;align-items:center;justify-content:center;padding:18px}.modal-card{width:min(980px,100%);max-height:min(88vh,980px);overflow:auto;border:1px solid var(--soft-border);border-radius:14px;background:#fff;padding:14px;box-shadow:0 20px 44px #0f172a47}.global-error{margin-top:10px;margin-bottom:0;padding:10px 12px;border:1px solid #f0c4c4;border-radius:10px;background:#fff4f4}h1,h2,h3{margin:0}h1{font-size:1.4rem}h2{font-size:1.2rem}h3{font-size:1.02rem}h4{margin:0;font-size:.94rem}.error{color:#b91c1c;margin-top:2px;font-size:.9rem}.hint{color:var(--muted);font-size:.84rem;margin:3px 0}.empty{margin-top:0;color:#64748b;font-size:.9rem}.compose-actions .hint{max-width:60%}.testing-block>.config-box,.testing-details-block>.config-box,.menu-block>.host-list-scroll{min-height:0}@media (max-width: 1360px){.panel{width:min(92vw,1300px)}.scripts-grid{grid-template-columns:1fr}.health-summary-grid{grid-template-columns:1fr 1fr}}@media (max-width: 1080px){.config-grid,.health-run-row{grid-template-columns:1fr}.testing-filters{grid-template-columns:1fr 1fr}.fleet-filters,.operations-grid,.testing-detail-grid,.diagnostics-tests-grid,.home-actions{grid-template-columns:1fr}}@media (max-width: 720px){.page{height:auto;min-height:100vh;padding:10px;overflow:auto}.panel{padding:12px}.dashboard-panel{height:auto}.toolbar{flex-direction:column;align-items:flex-start;gap:10px;position:static}.section-switcher{position:static;padding:6px 0 4px;grid-template-columns:1fr}.section-switch-btn{min-height:64px;font-size:1rem}.row-between{flex-direction:column;align-items:flex-start}.host-row{flex-direction:column;align-items:flex-start;gap:8px}.head-actions{flex-wrap:wrap}button,input,select,textarea{min-height:44px}.view-block,.detail-content,.testing-table-box,.testing-details-block .testing-detail-box{overflow:visible}.testing-table-scroll{display:none}.testing-cards{margin-top:10px;display:grid;gap:10px}.modal-backdrop{padding:10px}.modal-card{max-height:92vh;padding:10px}}
