/* History Tab
Scope: playback history tabs, tape list, and log stream display. */

#history-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.htab-btn {
  padding: 4px 12px;
  font-size: 12px;
  letter-spacing: 1px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text3);
  background: var(--bg2);
}
.htab-btn.active { border-color: var(--project-accent-secondary, var(--accent)); color: var(--project-accent-secondary, var(--accent)); }
.htab-btn:hover { color: var(--text); }

.hpanel { display: none; }
.hpanel.active { display: block; }

#tape-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tape-item {
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  cursor: pointer;
  transition: border-color 0.15s;
}
.tape-item:hover { border-color: var(--border2); }
.tape-item.selected { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(224, 92, 53, 0.3); }
.tape-item.done { border-left: 3px solid var(--green); }
.tape-item.error { border-left: 3px solid var(--red); }

.log-line.selected {
  background: rgba(224, 92, 53, 0.18);
  border-left-color: var(--accent);
  color: #f2f2f7;
}

.tape-row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.tape-dubid { font-size: 12px; color: var(--text3); }
.tape-status-dot { font-size: 12px; }
.tape-status-dot.done { color: var(--green); }
.tape-status-dot.error { color: var(--red); }

.tape-action { font-size: 13px; color: var(--text); }
.tape-path { font-size: 12px; color: var(--text2); margin-top: 2px; }
.tape-time { font-size: 12px; color: var(--text3); }

.tape-detail {
  display: none;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
}
.tape-item.expanded .tape-detail { display: block; }

.tape-detail pre {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text2);
  white-space: pre-wrap;
  word-break: break-all;
}

#log-stream-area {
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.6;
}

.log-stream-line { padding: 1px 0; color: var(--text2); }
.log-stream-line.pass  { color: var(--green); }
.log-stream-line.fail  { color: var(--red); }
.log-stream-line.ai    { color: var(--blue); }
.log-stream-line.code  { color: var(--yellow); }

#panel-history {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#panel-history .hpanel.active {
  min-height: 0;
}

#tape-list,
.log-stream-area {
  min-height: 0;
  max-height: calc(100vh - 260px);
  overflow: auto;
  padding-right: 4px;
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.55;
}

.log-stream-line {
  padding: 2px 6px;
  border-left: 2px solid transparent;
  color: var(--text2);
  white-space: pre-wrap;
  word-break: break-word;
}

.log-stream-line:hover,
.log-stream-line.selected {
  background: rgba(255,255,255,0.04);
}

.log-stream-line.pass { color: var(--green); border-left-color: var(--green); }
.log-stream-line.fail { color: var(--red); border-left-color: var(--red); }
.log-stream-line.ai { color: var(--blue); border-left-color: var(--blue); }
.log-stream-line.code { color: var(--yellow); border-left-color: var(--yellow); font-family: var(--font-mono); }
.log-stream-line.neutral { color: var(--text3); }
