.history-card {
  border-radius: var(--radius-xl);
  background: var(--color-card-bg);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
}

.history-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.history-title {
  font-weight: var(--font-weight-bold);
  color: var(--color-text-main);
  font-size: var(--font-size-xl);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.history-icon-clock {
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
}

.history-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-divider);
  background: transparent;
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.55rem;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.history-refresh-btn:hover,
.history-refresh-btn:focus-visible {
  background: rgba(0, 123, 255, 0.06);
  border-color: rgba(0, 123, 255, 0.25);
  color: var(--color-text-main);
  outline: none;
}

.history-subtitle {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-md);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
}

.history-item {
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  background: var(--color-card-bg);
  padding: 0.75rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.history-item:hover {
  background: rgba(0, 123, 255, 0.04);
  border-color: rgba(0, 123, 255, 0.22);
}

.history-item.is-selected {
  background: rgba(0, 122, 48, 0.08);
  border-color: rgba(0, 122, 48, 0.35);
}

.history-main {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
}

.history-doc-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.history-text {
  min-width: 0;
}

.history-line1 {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-line2 {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.history-score {
  font-weight: var(--font-weight-bold);
  min-width: fit-content;
}

.history-score.high { color: var(--color-success); }
.history-score.medium { color: var(--color-warning); }
.history-score.low { color: var(--color-error); }

.history-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.history-item:hover .history-actions,
.history-item:focus-within .history-actions {
  opacity: 1;
  pointer-events: auto;
}

.history-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.history-actions button:hover,
.history-actions button:focus-visible {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
  color: var(--color-text-main);
  outline: none;
}

.history-actions button.history-actions__danger:hover {
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.2);
  color: var(--color-error);
}

