* { box-sizing: border-box; }

body {
    font-family: var(--sans, 'JetBrains Mono', monospace);
    background: var(--bg1, #080c10);
    color: var(--txt, #ccdae8);
    margin: 0;
    padding: 12px;
    height: 100vh;
    overflow: hidden;
}

.layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 12px;
    height: calc(100vh - 24px);
    overflow: hidden;
}

.card {
    background: var(--bg2, #0d1218);
    border: 1px solid var(--bd2, #1e2c3e);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--bd2, #1e2c3e);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--acc, #00c8f0);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.main-header {
    flex-wrap: nowrap;
}

.meta-label {
    font-size: 10px;
    color: var(--txt2, #4a6a88);
    margin-left: 6px;
    font-weight: 400;
}

.tab-btns {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

.sidebar {
    overflow: hidden;
}

.main {
    overflow: hidden;
}

.trace-controls {
    padding: 10px;
    border-bottom: 1px solid var(--bd2, #1e2c3e);
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.row-gap { display: flex; gap: 6px; }

.inp {
    background: var(--bg1, #080c10);
    color: var(--txt, #ccdae8);
    border: 1px solid var(--bd2, #1e2c3e);
    padding: 7px 10px;
    border-radius: 4px;
    outline: none;
    font-size: 11px;
    font-family: var(--mono, monospace);
    flex: 1;
}

.inp:focus { border-color: var(--acc, #00c8f0); }

.hop-input { width: 52px; flex: none; text-align: center; }

.btn {
    background: var(--bg1, #080c10);
    color: var(--txt, #ccdae8);
    border: 1px solid var(--bd2, #1e2c3e);
    padding: 7px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-family: var(--sans, monospace);
    font-weight: 700;
    transition: border-color 0.15s, color 0.15s;
}

.btn:hover:not(:disabled) { border-color: var(--acc, #00c8f0); color: var(--acc, #00c8f0); }
.btn:disabled { cursor: not-allowed; }

.btn-acc {
    background: var(--acc, #00c8f0);
    color: #05090e;
    border-color: var(--acc, #00c8f0);
}
.btn-acc:hover:not(:disabled) { background: #00b0d0; border-color: #00b0d0; color: #05090e; }

.btn-full { width: 100%; }

.btn-sm { padding: 4px 10px; font-size: 10px; }

.tab-btn.active {
    background: var(--acc, #00c8f0);
    color: #05090e;
    border-color: var(--acc, #00c8f0);
}

.status-line {
    font-size: 10px;
    font-family: var(--mono, monospace);
    color: var(--txt2, #4a6a88);
    min-height: 14px;
    text-align: center;
}
.status-ok  { color: var(--ok,   #00e87a) !important; }
.status-err { color: var(--err,  #f04848) !important; }
.status-run { color: var(--warn, #ffa826) !important; }

.search-wrap {
    padding: 6px 10px;
    border-bottom: 1px solid var(--bd2, #1e2c3e);
    flex-shrink: 0;
}

.section-label {
    padding: 5px 12px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--txt2, #4a6a88);
    font-family: var(--mono, monospace);
    border-bottom: 1px solid var(--bd2, #1e2c3e);
    flex-shrink: 0;
}

.node-list {
    flex: 1;
    overflow-y: auto;
    background: var(--bg1, #080c10);
    min-height: 0;
}

.history-list {
    max-height: 170px;
    overflow-y: auto;
    background: var(--bg1, #080c10);
    flex-shrink: 0;
}

.empty-msg {
    padding: 20px;
    text-align: center;
    color: var(--txt2, #4a6a88);
    font-family: var(--mono, monospace);
    font-size: 10px;
}

.node-item {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    border-bottom: 1px solid var(--bd2, #1e2c3e);
    cursor: pointer;
    transition: background 0.15s;
}
.node-item:hover { background: rgba(0, 200, 240, 0.07); }

.node-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 10px;
}
.dot-online  { background: var(--ok, #00e87a); box-shadow: 0 0 5px var(--ok, #00e87a); }
.dot-offline { background: var(--bd2, #1e2c3e); }

.node-info { flex: 1; overflow: hidden; }
.node-name { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-sub  { font-size: 9px; color: var(--txt2, #4a6a88); font-family: var(--mono, monospace); }
.gps-icon  { color: var(--ok, #00e87a); margin-left: 3px; }

.history-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--bd2, #1e2c3e);
    cursor: pointer;
    transition: background 0.15s;
}
.history-item:hover { background: rgba(0, 200, 240, 0.07); }
.history-info { flex: 1; overflow: hidden; }
.history-id { font-size: 10px; color: var(--acc, #00aaf0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-ts { font-size: 9px; color: var(--txt2, #4a6a88); }

.pill {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
    margin-left: 8px;
}
.p-ok   { background: rgba(0,232,122,0.1); color: var(--ok, #00e87a); border: 1px solid var(--ok, #00e87a); }
.p-warn { background: rgba(255,168,38,0.1); color: var(--warn, #ffa826); border: 1px solid var(--warn, #ffa826); }

.tab-panel {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg1, #030710);
    min-height: 0;
}

.placeholder-msg {
    color: var(--txt2, #4a6a88);
    font-family: var(--mono, monospace);
    text-align: center;
    margin-top: 80px;
    font-size: 11px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-box {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--bd2, #1e2c3e);
    border-bottom: 2px solid var(--acc, #00c8f0);
    padding: 14px;
    border-radius: 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value { font-family: var(--mono, monospace); font-weight: 700; font-size: 20px; margin-bottom: 6px; }
.stat-label { font-size: 9px; color: var(--txt2, #4a6a88); font-weight: 800; letter-spacing: 1px; }

.paths-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.path-block {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(100,100,200,0.2);
    border-left-width: 3px;
    border-radius: 6px;
    padding: 14px 16px;
}

.path-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    font-family: var(--mono, monospace);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hop-row { display: flex; align-items: stretch; margin-bottom: 0; }

.hop-spine {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 28px;
    flex-shrink: 0;
    margin-right: 12px;
}

.hop-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    border: 2px solid;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
    margin-top: 2px;
}

.hop-line {
    width: 2px;
    flex: 1;
    min-height: 22px;
    margin: 2px 0;
}

.hop-content { flex: 1; }
.hop-nodes   { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hop-id      { font-family: var(--mono, monospace); font-size: 12px; font-weight: 700; }
.hop-arrow   { color: var(--txt2, #4a6a88); font-size: 10px; }
.hop-snr     { margin-left: auto; font-family: var(--mono, monospace); font-size: 10px; }
.hop-role    { font-size: 9px; color: var(--txt2, #4a6a88); margin-top: 2px; font-family: var(--mono, monospace); }

.raw-section { border-top: 1px solid var(--bd2, #1e2c3e); padding-top: 12px; }
.raw-json    { font-family: var(--mono, monospace); font-size: 10px; color: var(--txt2, #4a6a88); white-space: pre-wrap; word-break: break-all; margin: 0; line-height: 1.6; }

.map-alert {
    background: rgba(255,168,38,0.1);
    border-top: 1px solid rgba(255,168,38,0.3);
    padding: 8px 14px;
    font-family: var(--mono, monospace);
    font-size: 10px;
    color: var(--warn, #ffa826);
    flex-shrink: 0;
}

.mono { font-family: var(--mono, monospace); }
