.context-log-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.context-log-rail,
.context-log-summary,
.context-log-row,
.context-log-decision {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.context-log-rail {
    padding: 10px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.context-log-rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.context-log-run {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 9px;
    margin-bottom: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-panel);
    color: var(--text-muted);
    text-align: left;
    cursor: pointer;
}

.context-log-run.active {
    border-color: rgba(0,255,136,0.38);
    background: rgba(0,255,136,0.06);
    color: var(--text-main);
}

.context-log-run span,
.context-log-row-head span {
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.context-log-run small {
    color: var(--text-dim);
    font-size: 0.72rem;
}

.context-log-main {
    min-width: 0;
}

.context-log-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(90px, 1fr));
    gap: 10px;
    padding: 14px;
    margin-bottom: 14px;
}

.context-log-kpi span,
.context-log-selection span {
    display: block;
    margin-bottom: 4px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.context-log-kpi strong {
    color: var(--text-main);
    font-size: 1rem;
}

.context-log-selection {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.context-log-selection > div,
.context-log-refs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}

.context-log-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 14px;
}

.context-log-row,
.context-log-decision {
    padding: 10px 12px;
    margin-bottom: 8px;
}

.context-log-row-head {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    margin-bottom: 7px;
    color: var(--accent);
}

.context-log-row-head time {
    justify-self: end;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.context-log-row p,
.context-log-decision p {
    margin: 0 0 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.context-log-decision strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text-main);
    font-size: 0.82rem;
    line-height: 1.35;
}

.context-log-empty {
    color: var(--text-dim);
    font-size: 0.72rem;
}

@media (max-width: 980px) {
    .context-log-shell,
    .context-log-grid,
    .context-log-selection {
        grid-template-columns: 1fr;
    }
    .context-log-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
