.history-container { max-width: 800px; }
.history-container h2 { font-size: var(--fs-xl); margin-bottom: var(--spacing-sm); }
.history-subject {
  font-size: var(--fs-sm); color: var(--text-secondary); margin-bottom: var(--spacing-xl);
}
.history-subject strong { color: var(--text-dark); }

.history-toolbar {
  display: flex; align-items: center; gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}
.history-toolbar .select { width: auto; min-width: 140px; }

.history-timeline { position: relative; }
.history-timeline::before {
  content: ''; position: absolute; left: 15px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}

.history-entry {
  position: relative; display: flex; gap: var(--spacing-lg);
  padding-bottom: var(--spacing-lg);
}
.history-entry:last-child { padding-bottom: 0; }

.history-dot {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 50%; background: var(--bg-surface);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); z-index: 1;
}
.history-entry.insert .history-dot { border-color: var(--success); color: var(--success); }
.history-entry.update .history-dot { border-color: var(--accent); color: var(--accent); }
.history-entry.delete .history-dot { border-color: var(--danger); color: var(--danger); }

.history-card {
  flex: 1; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.history-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--border);
}
.history-card-title {
  display: flex; align-items: center; gap: var(--spacing-sm);
}
.history-card-title .version { font-weight: 600; font-size: var(--fs-sm); color: var(--text-dark); }
.history-card-title .action-badge {
  padding: 2px 8px; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 500;
}
.history-entry.insert .action-badge { background: rgba(69,151,69,0.15); color: var(--success); }
.history-entry.update .action-badge { background: var(--accent-subtle); color: var(--accent); }
.history-entry.delete .action-badge { background: rgba(255,83,71,0.15); color: var(--danger); }

.history-card-meta { font-size: var(--fs-xs); color: var(--text-muted); }
.history-card-actions { display: flex; gap: var(--spacing-sm); }
.history-card-body { padding: var(--spacing-lg); }

.history-diff {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  background: #f8f8f8; border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md); overflow-x: auto;
  line-height: 1.6;
}
.diff-line { padding: 1px var(--spacing-sm); border-radius: 2px; }
.diff-line.added { background: rgba(69,151,69,0.12); color: var(--success); }
.diff-line.removed { background: rgba(255,83,71,0.12); color: var(--danger); }
.diff-line.context { color: var(--text-muted); }
.diff-key { color: var(--info); }
.diff-value { color: var(--text-dark); }

.history-snapshot {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  background: #f8f8f8; border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--spacing-md); overflow-x: auto;
  line-height: 1.6; color: var(--text-secondary);
  max-height: 200px; overflow-y: auto;
}

.history-compare {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}
.history-compare-pane {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.history-compare-pane-header {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--fs-xs); font-weight: 600;
  background: var(--bg-surface-hover); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.history-compare-pane-body { padding: var(--spacing-md); }
