/* ============================================================
   LLMBench · Live-View (§4.5)
   Status-Strip · Progress · Sub-Liste · Event-Stream
   ============================================================ */

.live-view { margin-bottom: 18px; }

.live-view-head {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.live-view-head-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.live-view-head .chev {
    display: inline-block;
    transition: transform .15s ease;
    color: var(--ink-3);
    font-size: 18px;
    line-height: 1;
}
.live-view-head .chev.open { transform: rotate(90deg); }

.live-view-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 10px;
}

.live-view.collapsed .live-view-body { display: none; }

/* === §4.5/1 Status-Strip ============================================== */
.live-status-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 8px 10px;
    background: var(--bg-2);
    border-radius: var(--r-md);
    font-size: var(--t-sm);
}
.live-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: var(--r-sm);
    background: var(--card);
    border: 1px solid var(--line);
    font-size: var(--t-xs);
    font-weight: 600;
    letter-spacing: .04em;
}
.live-status-pill .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--ink-4);
}
.live-status-pill.status-running .dot { background: #1f9d55; }
.live-status-pill.status-completed .dot { background: var(--ink-1); }
.live-status-pill.status-failed .dot,
.live-status-pill.status-aborted .dot { background: var(--accent); }

.heartbeat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.heartbeat-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.04);
}
.heartbeat-green .heartbeat-dot {
    background: #1f9d55;
    animation: hb-pulse 1.4s infinite;
}
.heartbeat-yellow .heartbeat-dot { background: #d8a72a; }
.heartbeat-red .heartbeat-dot { background: #c0392b; }
@keyframes hb-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(31,157,85,0.45); }
    70%  { box-shadow: 0 0 0 6px rgba(31,157,85,0);    }
    100% { box-shadow: 0 0 0 0 rgba(31,157,85,0);      }
}

.live-status-strip .elapsed {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-variant-numeric: tabular-nums;
}
.live-status-strip .pill.warn {
    background: var(--accent-bg);
    color: var(--accent-2);
    border: 1px solid var(--accent-bg-2);
    padding: 2px 8px;
    border-radius: var(--r-sm);
    font-size: var(--t-xs);
}
.live-status-actions { margin-left: auto; }

/* === §4.5/2 Progress ================================================== */
.live-progress-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.live-progress-meta {
    display: flex;
    gap: 14px;
    font-size: var(--t-sm);
    align-items: baseline;
    flex-wrap: wrap;
}
.live-progress-bar {
    position: relative;
    height: 10px;
    background: var(--line);
    border-radius: 6px;
    overflow: hidden;
}
.live-progress-fill {
    height: 100%;
    background: var(--ink-1);
    transition: width .35s ease;
    border-radius: 6px;
}
.live-progress-stripes {
    background-image: repeating-linear-gradient(
        45deg,
        var(--accent),
        var(--accent) 8px,
        var(--accent-2) 8px,
        var(--accent-2) 16px
    );
    background-size: 22.6px 22.6px;
    animation: stripes-shift 1.2s linear infinite;
}
@keyframes stripes-shift {
    from { background-position: 0 0; }
    to   { background-position: 22.6px 0; }
}

/* === §4.5/3 Sub-Liste ================================================= */
.live-sub-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.live-sub-row {
    display: grid;
    grid-template-columns: 18px 1fr auto 140px;
    gap: 10px;
    align-items: center;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--card);
    font-size: var(--t-sm);
}
.live-sub-row.sub-state-done    { color: var(--ink-2); border-color: var(--line); }
.live-sub-row.sub-state-running { border-color: var(--ink-4); background: var(--bg-2); }
.live-sub-row.sub-state-error   { border-color: var(--accent); }
.live-sub-row.sub-state-pending { color: var(--ink-3); }

.live-sub-icon {
    text-align: center;
    color: var(--ink-3);
    font-weight: 700;
}
.live-sub-row.sub-state-done .live-sub-icon    { color: #1f9d55; }
.live-sub-row.sub-state-running .live-sub-icon { color: var(--accent); }
.live-sub-row.sub-state-error .live-sub-icon   { color: #c0392b; }

.live-sub-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--mono);
    font-size: var(--t-sm);
}
.live-sub-counts { font-variant-numeric: tabular-nums; }
.live-sub-counts .warn { color: var(--accent-2); }

.live-sub-bar {
    height: 6px;
    background: var(--line);
    border-radius: 3px;
    overflow: hidden;
}
.live-sub-bar-fill {
    height: 100%;
    background: var(--ink-1);
    transition: width .25s ease;
    border-radius: 3px;
}
.sub-state-error .live-sub-bar-fill { background: var(--accent); }
.sub-state-done .live-sub-bar-fill  { background: #1f9d55; }

/* === §4.5/4 Event-Stream ============================================== */
.live-event-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.live-event-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    flex-wrap: wrap;
}
.live-event-toolbar-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}
.live-event-toolbar .warn { color: var(--accent-2); }

.live-event-stream {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--side-bg);
    color: var(--side-ink-1);
    font-family: var(--mono);
    font-size: var(--t-sm);
}
.live-event-empty { padding: 12px; }

.live-event-row {
    display: grid;
    grid-template-columns: 70px 60px auto 1fr;
    gap: 10px;
    padding: 4px 10px;
    border-bottom: 1px solid var(--side-line);
    cursor: pointer;
    align-items: start;
}
.live-event-row:hover { background: var(--side-bg-2); }
.live-event-row.level-warn  { color: #ffd28a; }
.live-event-row.level-error { color: #ff8a8a; }
.live-event-row.level-debug { color: var(--side-ink-3); }

.live-event-ts { color: var(--side-ink-3); font-variant-numeric: tabular-nums; }
.live-event-level {
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--side-ink-2);
}
.live-event-row.level-warn .live-event-level  { color: #ffd28a; }
.live-event-row.level-error .live-event-level { color: #ff8a8a; }

.live-event-sub { color: var(--side-ink-2); }
.live-event-msg {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.live-event-context {
    grid-column: 1 / -1;
    margin-top: 6px;
    padding: 8px;
    background: var(--side-bg-2);
    border-radius: var(--r-sm);
    overflow-x: auto;
}
.live-event-context pre {
    margin: 0;
    color: var(--side-ink-1);
    font-size: var(--t-xs);
    white-space: pre;
}

.live-end-hint {
    padding: 8px 0;
    border-top: 1px dashed var(--line);
}

/* === Adapter-Progress-Banner (Welle B, 2026-05-11) =====================
   Sichtbar zwischen Gesamt-Progress und Sub-Liste, wenn ein Adapter
   live Fortschritts-Events emittiert (alle ~30 s). lm-eval ist der
   Pilot; BFCL/Promptfoo werden später ebenfalls hier auftauchen. */
.live-adapter-progress-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

.live-adapter-progress-row {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--bg-2);
}

.live-adapter-progress-row.stale {
    opacity: 0.65;
}

.live-adapter-progress-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.live-adapter-progress-name {
    font-family: var(--mono);
    font-size: var(--t-sm);
    color: var(--ink-2);
}

.live-adapter-progress-counts {
    font-size: var(--t-md);
    font-variant-numeric: tabular-nums;
}

.live-adapter-progress-meta {
    margin-left: auto;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-variant-numeric: tabular-nums;
}

.live-adapter-progress-meta .warn {
    color: var(--accent-2);
}

.live-adapter-progress-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--line);
    overflow: hidden;
}

.live-adapter-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 1s linear;
}
